views:

465

answers:

4

Hello, 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 target 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

A: 

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.

Reed Copsey
+4  A: 

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.

Clyde
+1  A: 

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.

Ngu Soon Hui
Only System.Core and System.Web.Extensions are referenced as .NET 3.5 references. So I guess everything else is allright and my solution converted to .NET 3.5 ...?
Vytas
Yes, it's allright; all your .net 2.0 can be converted to 3.5 without hassle.
Ngu Soon Hui
A: 

Hi When I add: using System.Core; the error disappears from my error list and the "red" wavy line under "Linq" in using System.Linq; also disappears. However, when I compile my Solution 2 errors appear in my error list and the words "Linq" and "Core" are underlined with "blue" wavy lines! The error messages are the same as the original: ... The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Users\Mark\Documents\Expression\Blend 3\Projects\TestApp\TestAppSite\App_Code\TestService.cs and ... The type or namespace name 'Core' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Users\Mark\Documents\Expression\Blend 3\Projects\TestApp\TestAppSite\App_Code\TestService.cs Any ideas anyone? This is my test project to replicate the problem I'm experiencing in my main project. Thanks, Mark.

Mark
You should better ask this as a new question, more people would look at it and try to help you. (And it's not an answer to this question, so not very helpful here in that respect.)
sth