Jump to content
Xtreme .Net Talk

How to build a backwards compatible assembly for .NET 1.1 or .NET 1.0 with VS 2005?


Recommended Posts

Posted

Does anyone know, if it is possible to build a backwards compatible assembly for .NET 1.1 or .NET 1.0 with VS 2005?

Or is the only way to do this using the corresponding VS 2003 or VS 2002?

Posted

The trick is to use elements of the .Net framework that are supported across all versions. If you build an app in VS2005 (.Net Framework 2.0) and you don't do anything too crazy, then it will probably run on 1.1 and maybe even 1.0. There are some major differences in terms of functionlity and support in the framework from version to version and esspecially from v1.1 to v2.0, but generally speaking, you target a framework to ensure the app will run on that framework, but as far as I know IL is IL no matter which way you shake it. That's why the Mono project is able to exist.

 

That said, you get no gaurentness if you target one framework and try and run it on another...

  • Leaders
Posted
That's why the Mono project is able to exist.

Don't you have to specifically target mono (idk, in #Develop, it gives you an option between microsoft and mono)? Also note that if you build an app on VB.Net 2003, and target framework 1.1 (this is the default setting), it will not run on 1.0. You must go to the project properties and set the target to "Both Microsoft .NET Framework v1.1 and v1.0 (advanced)".

[sIGPIC]e[/sIGPIC]
Posted

I guess the IL syntax did changed between 1.0 and 1.1 (and most likely 2.0) that would cause that to break. Mono1.1, is supposed to be a port of v1.1 so it will run any 1.1 program. Targetin mono specificaly will ensure that it will run on Mono becuase it is not a complete port. I have, however, run programs written in the VS IDE on Mono (on a Linux Box of all things).

 

So, I guess there are differences with regards to compilation across the frameworks and minor variants in syntax. Kind of a bummer, but it makes sense.

 

What about a 1.0 running on the 1.1 framework?

Posted

.NET apps are mostly forward compatible, but not backward compatible.

 

i.e.,

an app targeting 1.0 will run on 1.0, 1.1, and 2.0

an app targeting 1.1 will run on 1.1 and 2.0

 

Do I have this right?

  • Leaders
Posted

To the best of my knowlegde this is correct. From MSDN (ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpcontargetingnetframeworkversion.htm):

Note that applications built with .NET Framework version 1.0 automatically run with .NET Framework version 1.1 unless specifically configured not to.

[/Quote]

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...