Switching from .Net 3.5 to 2.0
When you start a new project, .Net 3.5 is used by default. Is there a correct procedure for switching to 2.0? When I attempt to do so in my test program, I wound up with errors.
Edward K.
When you start a new project, .Net 3.5 is used by default. Is there a correct procedure for switching to 2.0? When I attempt to do so in my test program, I wound up with errors.
Edward K.
Hi Edward.
The correct procedure involves a few manual steps beyond changing the Target Framework dropdown to ".NET Framework 2.0" in the Application tab of the Project Designer.
Default .NET Framework 3.5 projects have three .NET 3.5-specific references added automatically: System.Core, System.Data.DataSetExtensions and System.Xml.Linq. You'll need to remove these manually. The default source files also have a using statement for System.Linq to allow you to write the new query expression syntax in C# 3.0. Since this namespace is defined in the System.Core references you just removed, you'll need to get rid of it as well.
Depending on how much you've done in your app which is .NET 3.5 specific (do you have any query expressions in your code? use var? use the new object initializer syntax?), you may have to do more than these few steps to get back to a .NET 2.0 project.
Hope that helps! Please let me know if you have any other questions.
Scott Nonnenberg
scottno@microsoft.com
Scott,
In my case this was something I was trying to see how it would work. I am in the learning process so I have no need to back track to .NET 2.0 once the final release is out. Is this one area that is still being worked on because I would think that an individual would have a choice before starting a project instead of after? This way you would not have to worry about removing references to .NET 3.5 by hand.
Edward K.
Yep, we do allow you select the framework beforehand - in the new project dialog, there is a drop-down which allows you to decide which version of the .NET Framework you targeting. By default .NET 3.5 is selected since it's the latest.
Scott Nonnenberg