How to convert Windows application from .NET2.0 to .NET3.5
I have problem, when converting Windows application from .NET2.0 to .NET3.5. I do this like so: 1. In Win XP I start VS2008 and open my solution project which consists of 4 projects; 2. On all of these 4 project Properties window in tab "Application" I select tar开发者_StackOverflow中文版get framework value ".NET Framework 3.5" 3. I rebuild the solution, but all the old references to .NET 2.0 remains... It was written, that all the references after converting from 2.0 to 3.5 must be referenced automaticaly to 3.5 dll's, that are on my computer.
What I do wrong? Please help with some advice. Thanks
You're probably already OK. Even though it sounds like 3.5 is an upgrade of 2.0, it's actually more of an extension of 2.0. All the dlls like System, System.Data, etc. will still be version 2.0. There isn't any 3.5 version of System.Data. The difference in a 3.5 project is that there are NEW dlls like System.Core, System.Xml.Linq, etc. that will all be version 3.5
Create a new 3.5 project, and compare the references from that project to your upgraded project and you'll see what I mean.
How do you know whether you are referencing to .net 2.0 instead .net 3.5? Because .net 3.5 is just an extension of .net 2.0, and basically all .net 3.5 are also .net 2.0 assemblies. So if your code can compile when you are targeting .net 3.5, you are already on 3.5
If you target .net 3.5, then that means that some extra assemblies will be enabled for compilation ( such as LINQ related assemblies), if you target .net 2.0, this means that those assemblies are not enabled.
All your .net 2.0 can be converted to 3.5 without hassle.
As long as you never changed your project's references to reference a "specific version" of the system assemblies, they'll all automatically switch to the 3.5 versions.
You will, though, need to add a reference to anything new in 3.5. My guess is that you're probably missing the reference to System.Core
, which will add LINQ support.
精彩评论