Thursday, November 14, 2013

Downgrading One ASP.NET 4.5 to ASP.NET 4.0

As many of you know, in Visual Studio 2013, if you create a new project using the One ASP.NET Web Application template, you can only create it using .NET Framework v. 4.5.

However, if you want to downgrade it for use with .NET Framework v. 4.0, you will receive the following error message in Visual Studio:

Therefore, if you want to downgrade to .NET v. 4.0, it means that you will have to modify all of your NuGet Packages in order to work with .NET v. 4.0.

  1. Right-click on the project and select "Manage NuGet Packages"
  2. Click on the Updates-->All link
  3. You will be presented with an option to "Update All"
  4. Click on the "Update All" button to proceed to download all of the compliant NuGet packages for .NET 4.0.
  5. Re-build your project
  6. You may get error messages for System.Web.Mvc and Microsoft.AspNet.FriendlyUrls.
  7. For the System.Web.Mvc assembly, browse to the .NET 4.0 version in the Assemblies section of References
  8. For the Microsoft.AspNet.FriendlyUrls assembly, browse to the .NET 4.0 version in the NuGet packages directory.
  9. Re-build the project once more.
  10. If the project compiles, you have just migrated your One ASP.NET Project from .NET 4.5 to .NET 4.0!

No comments:

Post a Comment