KKR
KKR

Reputation: 79

Dotnet 4.0 upgrade from 2.0

i am working on a dotnet C# web application which was initially created with VS 2003. My goal is to upgrade this application to Dotnet 4.0 without changing any functionaltiy. The solution has 9 projects (1 web + 8 Library projects). The Web project refers the 8 libraries in DLLs. To start off, I created a New project in VS2010 and added the all the Project files from the existing source code. Every time i add a project file to my solution, i was prompted with the Converison wizard and i completed the conversion wizard succesfully and now the solution works fine. After the conversion, i noticed that Except the "Web" project, other projects are converted to Dotnet 2.0 but not 4.0. My application runs without error if i run it locally using VS2010. My questions are

  1. Why the Class libaray project did not upgrade to 4.0? Currently the Web project is shows up as Dotnet 4.0 and Libaray projects shows up as Dotnet 2.0.
  2. Can i deploy the application to IIS 7.0 with the Dotnet runtime of 4.0? Will the Dlls created in version 2.0 work if my application uses Dotnet 4.0 runtime version?

Please help...

Upvotes: 1

Views: 1675

Answers (2)

Ran
Ran

Reputation: 6159

If your'e migrating now, why not move directly to Visual Studio 2012, instead of 2010?

Anyway, what you can do is open the project properties in each of your projects, and change the target framework to the .NET framework 4.0.

Then if you get any compilation error you can probably easily solve it individually. This should be relatively easy if your projects are not too big.

As for your specific questions:

  1. The automatic conversion would only change the format of the solution/projects to be compatible with the new version Visual Studio. It shouldn't change the target framework but you can change that yourself.

  2. Yes, assemblies targeting .NET 2.0 can be loaded and used from assemblies targeting .NET 4.0.

Upvotes: 4

AaronLS
AaronLS

Reputation: 38394

1) Upgrading the solution/projects file only upgrades it's format so you can open it in VS 2010. It will usually leave the targeted .NET setting at the previous value. These are two seperate things. The wonderful thing about VS 2010 is it let's you target whatever version of .NET you desire, so no longer do you need multiple version of VS installed to support differnt .NET versions. It didn't change the targetted .NET version because it leaves it up to you. You can change it under the project settings and recompile your library projects to regenerate the DLLs

2) You will need an application pool for .NET 4. .NET is backwards compatible in that a .NET 2.0 app can run on a machine with .net 4 installed. However, the application pool for 2.0 applications must be separate from 4.0 apps. So it's just a matter of putting the app under the right app pool.

Upvotes: 1

Related Questions