Question

I have a basic server control that I've written using .NET 3.5. If I give that dll to someone who is running a .NET 2.0 application, will it work?

Was it helpful?

Solution

Unless you are referencing any DLL's included in .NET 3.0 or 3.5 then yes it should work because the CLR versions are the same in .NET 2.0, 3.0, and 3.5. I believe there may have been minor changes to the 2.0 assemblies ("red bits") but I'll have to double check.

You can even just change the project properties in Visual Studio to target .NET 2.0 to be sure. If your app doesn't compile then it wouldn't have run on .NET 2.0 anyway.

Scott Hanselman has posted about .NET 2.0-3.5 differences.

OTHER TIPS

The first thing you should do is try changing the Target Framework to 2.0 and see if your Server Control project still compiles (Right click on the project, choose Properties, then change the Target Framework to ".NET Framework 2.0" and choose "Yes" in the "Target Framework Change" dialog). If it still compiles you're off to a fairly good start. Now compile it, add it to a new web site and check to see if it works.

Most of the time you'll probably find that your control won't be using any 3.5 specific features, so once you've tried compiling it against 3.5 you'll be good to go!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top