473,409 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Can't taget particular .NET runtime

When attempting to target a specific version of the .NET Framework in my
application configuration file, I get an error saying that: "To run this
application, you must first install one of the following versions of the.NET
framework:..." and then it lists the version that I targetted in my config
file.

I am building this with VS 2008 and the 3.5 framework, but am not using or
referencing any assemblies that are specific to 3.5 - just a very basic
class library project.

I DO have all the prior versions of the framework installed (including the
one I'm targetting in my config file).

What do you think?
Jul 13 '08 #1
6 1479
Scott M. wrote:
When attempting to target a specific version of the .NET Framework in my
application configuration file, I get an error saying that: "To run this
application, you must first install one of the following versions of the.NET
framework:..." and then it lists the version that I targetted in my config
file.

I am building this with VS 2008 and the 3.5 framework, but am not using or
referencing any assemblies that are specific to 3.5 - just a very basic
class library project.

I DO have all the prior versions of the framework installed (including the
one I'm targetting in my config file).

What do you think?
I think you've neglected to give us the most important bit of information
needed to diagnose the problem, which is the actual configuration file.

As far as I know you can't target specific frameworks at all. You can only
target specific runtimes, which is not the same thing. A runtime version is
something along the lines of "v2.0.50727" for .NET 2.0.

Under normal circumstances, it simply isn't necessary to specify a runtime
version. This should only be used if your application has compatibility
issues that prevent it from being run by a later runtime than the one it was
written for. If you're using VS 2008, you cannot be developing a .NET 1.x
application, so this probably doesn't apply.

If you want to ensure your 3.5 or 3.0 application will run on a 2.0
configuration, simply remove any references to 3.0 or 3.5 assemblies. The
runtime is the same for the 2.0, 3.0 and 3.5 frameworks. Well, almost --
..NET 3.5 will install the 2.0 SP1 runtime, but this is different only in
build number.

--
J.
Jul 13 '08 #2
"Jeroen Mostert" <jm******@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl...
Scott M. wrote:
>When attempting to target a specific version of the .NET Framework in my
application configuration file, I get an error saying that: "To run this
application, you must first install one of the following versions of
the.NET framework:..." and then it lists the version that I targetted in
my config file.

I am building this with VS 2008 and the 3.5 framework, but am not using
or referencing any assemblies that are specific to 3.5 - just a very
basic class library project.

I DO have all the prior versions of the framework installed (including
the one I'm targetting in my config file).

What do you think?
I think you've neglected to give us the most important bit of information
needed to diagnose the problem, which is the actual configuration file.

As far as I know you can't target specific frameworks at all. You can only
target specific runtimes, which is not the same thing. A runtime version
is something along the lines of "v2.0.50727" for .NET 2.0.
<startup>
<requiredRuntime version="2.0.50727" safemode="true" />
</startup>
>
Under normal circumstances, it simply isn't necessary to specify a runtime
version. This should only be used if your application has compatibility
issues that prevent it from being run by a later runtime than the one it
was written for. If you're using VS 2008, you cannot be developing a .NET
1.x application, so this probably doesn't apply.

If you want to ensure your 3.5 or 3.0 application will run on a 2.0
configuration, simply remove any references to 3.0 or 3.5 assemblies. The
runtime is the same for the 2.0, 3.0 and 3.5 frameworks. Well, almost --
.NET 3.5 will install the 2.0 SP1 runtime, but this is different only in
build number.
I understand, but I need to be able to demonstrate the behavior nonetheless.

>
--
J.

Jul 13 '08 #3
Scott M. wrote:
"Jeroen Mostert" <jm******@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl...
>Scott M. wrote:
>>When attempting to target a specific version of the .NET Framework in my
application configuration file, I get an error saying that: "To run this
application, you must first install one of the following versions of
the.NET framework:..." and then it lists the version that I targetted in
my config file.

I am building this with VS 2008 and the 3.5 framework, but am not using
or referencing any assemblies that are specific to 3.5 - just a very
basic class library project.

I DO have all the prior versions of the framework installed (including
the one I'm targetting in my config file).

What do you think?
I think you've neglected to give us the most important bit of information
needed to diagnose the problem, which is the actual configuration file.

As far as I know you can't target specific frameworks at all. You can only
target specific runtimes, which is not the same thing. A runtime version
is something along the lines of "v2.0.50727" for .NET 2.0.

<startup>
<requiredRuntime version="2.0.50727" safemode="true" />
</startup>
That's wrong in two ways: only 1.0 applications should use
<requiredRuntime>, later versions must use <supportedRuntime>. Second, the
version number (name, actually) has to match a directory name in
%WINDIR%\Microsoft.NET\Framework *exactly*. So make it

<startup>
<supportedRuntime version="v2.0.50727" />
</startup>

--
J.
Jul 13 '08 #4
Ok thanks. I was actually using the code from Professional Visual Basic
2008, page 968-969 and they show it with those two incorrect items.

Is there a way to verify the runtime version that is currently running the
assembly? Something in System.Reflection?

"Jeroen Mostert" <jm******@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl...
Scott M. wrote:
>"Jeroen Mostert" <jm******@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl.. .
>>Scott M. wrote:
When attempting to target a specific version of the .NET Framework in
my application configuration file, I get an error saying that: "To run
this application, you must first install one of the following versions
of the.NET framework:..." and then it lists the version that I
targetted in my config file.

I am building this with VS 2008 and the 3.5 framework, but am not using
or referencing any assemblies that are specific to 3.5 - just a very
basic class library project.

I DO have all the prior versions of the framework installed (including
the one I'm targetting in my config file).

What do you think?
I think you've neglected to give us the most important bit of
information needed to diagnose the problem, which is the actual
configuration file.

As far as I know you can't target specific frameworks at all. You can
only target specific runtimes, which is not the same thing. A runtime
version is something along the lines of "v2.0.50727" for .NET 2.0.

<startup>
<requiredRuntime version="2.0.50727" safemode="true" />
</startup>
That's wrong in two ways: only 1.0 applications should use
<requiredRuntime>, later versions must use <supportedRuntime>. Second, the
version number (name, actually) has to match a directory name in
%WINDIR%\Microsoft.NET\Framework *exactly*. So make it

<startup>
<supportedRuntime version="v2.0.50727" />
</startup>

--
J.

Jul 13 '08 #5
Scott M. wrote:
Ok thanks. I was actually using the code from Professional Visual Basic
2008, page 968-969 and they show it with those two incorrect items.
Tut tut. Well, I guess it shows that you can't believe everything you
read... Though that's still quite disappointing. It would have been a simple
matter for the authors to verify. I'll put this book on my list of books to
look into. There are some bad ones out there and I'd like to know what not
to recommend.
Is there a way to verify the runtime version that is currently running the
assembly? Something in System.Reflection?
System.Environment.Version.

But for heaven's sake, don't use this for anything more than informative
purposes (logging and error reports and such). Using this to check
compatibility is a very bad idea. If your assembly runs, you should, well,
run with it.

--
J.
Jul 13 '08 #6
Yes, I understand. But, as I said this is for demonstration purposes.

Thanks.
"Jeroen Mostert" <jm******@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl...
Scott M. wrote:
>Ok thanks. I was actually using the code from Professional Visual Basic
2008, page 968-969 and they show it with those two incorrect items.
Tut tut. Well, I guess it shows that you can't believe everything you
read... Though that's still quite disappointing. It would have been a
simple matter for the authors to verify. I'll put this book on my list of
books to look into. There are some bad ones out there and I'd like to know
what not to recommend.
>Is there a way to verify the runtime version that is currently running
the assembly? Something in System.Reflection?
System.Environment.Version.

But for heaven's sake, don't use this for anything more than informative
purposes (logging and error reports and such). Using this to check
compatibility is a very bad idea. If your assembly runs, you should, well,
run with it.

--
J.

Jul 14 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Paul | last post by:
public class A { public A () { // here I would like to call the second version of _ctor, how to accomplish this ? } public A (int a, int b, int c) {
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
9
by: junaidnaseer | last post by:
ok I know I posted this question previously and then I got a reply and I realized that I had asked a really dumb question but now I realize that my question wasn't that dumb at all ! I had asked...
2
by: mangesh | last post by:
Garbage collection is done at runtime .Then how compiler can assist it. Compiler plays no role at runtime . It is stated so on link "http://www.iecc.com/gclist/GC-faq.html#Common%20questions" . ...
2
by: Rex | last post by:
Hi, I want to make a particular piece of text BOLD (during runtime) in a textbox. for example: consider a string "The next stage for plaque collection will be at the end of January". I want to...
0
by: Mohanss | last post by:
how to filter the particular filed in datagridview at runtime in vb formns
4
by: =?Utf-8?B?QWJoaQ==?= | last post by:
I am using Reflection to invoke methods dynamically. I have got a special requirement where I need to pass a value to method by setting the custom method attribute. As I cannot change the...
4
by: Bill Fuller | last post by:
I am trying to determine the type for ActiveControls using 3rd party controls (Infragistics in this case) during runtime and getting a rather odd return type at runtime for the UltraWinEditor. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.