.net framework version, visual studio '03

J

jroozee

I am developing in VS '03. I have all of the current framework
versions installed on my PC, 1.1, 2.0, and 3.0.

How can I make sure the code I am developing in is using the 3.0
framework version? Or do I need to be using the latest version of
Visual Studio to do so?


Thanks,

Jason
 
G

Guest

You can use a config file to direct the runtime to use a particular version
of the framework.

The config file must be named the same as the dll or the exe, but with
..config at the end...
MyApp.exe.config
MyAppLib.dll.config

You can write the config file, if it does not already exist, in notepad, and
add it to the project.

Here is an example of a config file

<?xml version ="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v1.1.4322" />
</startup>
</configuration>

Just name the file as stated above, and use one of these files for each
project in the solution. Also...get the exact version number for 3.0 and
insert it in place of version="v1.1.4322" as shown above.

Caution: AT DESIGN TIME, when attempting to use a later version of the
framework using an older version of VB.net, your design-time views of forms
may not be available. To alleviate this, use the compatible framework that
your design environment was intended for. When you compile for runtime, you
can switch out the referenced assemblies and add the config file. (Actually,
I think you only have to switch one reference for each project, and the rest
happen automatically.)

This is a tricky proposition, because you are actually writing code as
though it will be compiled against the expected framework. I would only
suggest doing this if you have a distinct reason for doing so.

Recently, I needed the System.Net.Mail namespace instead of the
System.Web.Mail namespace due to an additional method that I needed. Except
when I was testing for that method, I still was running the compatible
framework. When compiling the release, I did the switch. (You need to be
sure the config file is properly directed, or only present when compiling to
the "mis-matched" framework).

You should do serious beta testing for compatibility issues.

By default, I think that the compiled exe and dll's, whatever framework they
are compiled to run under, will find the closest framework available on the
system they are running on (unless the config file provides distinct
direction).

http://msdn2.microsoft.com/en-us/library/aa720684(VS.71).aspx
 
C

Cor Ligthert[MVP]

j,

Version 2003 is made for Net 1.1 you cannot make programs for higher Net
versions with that.

Cor
 
M

Michel Posseth [MCP]

you cannot make programs for higher Net versions with that.

Well actually you can , i have once tested a 1.1 app on a 2.0 framework (
clean pc with only framework 2.0 installed ) and to my own surprise it
worked without anny noticable problems.

So i guess the.Net framework is backwards compatible to some point

HTH

Michel
 
C

Cor Ligthert[MVP]

Michel,

In my idea that was always written that it was the goal. However as we can
see by all the post about this, I have not much believe in it.

Cor
 
H

Herfried K. Wagner [MVP]

Michel Posseth said:
Well actually you can , i have once tested a 1.1 app on a 2.0 framework
( clean pc with only framework 2.0 installed ) and to my own surprise it
worked without anny noticable problems.

So i guess the.Net framework is backwards compatible to some point

That's true (there are some cases in which it won't work though).
Nevertheless, VS.NET 2003 will create .NET 1.1 assemblies and cannot be
altered to create .NET 2.0 assemblies.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top