Thursday, July 18, 2013

Upgrading a Sitefinity v. 6.x Web Application to ASP.NET v. 4.5

You may have noticed that by default, the Sitefinity Project Manager creates Sitefinity Web Applications only using ASP.NET 4.0.

But what if you want to upgrade your Sitefinity Web Application to ASP.NET 4.5 so that you can take advantage of all of the new and great features that have been included with ASP.NET 4.5?

Well, you can do so, but not directly through any of the Sitefinity tooling.

For this, you have to revert to Visual Studio 2012.

  1. Open up Visual Studio 2012
  2. Select the Sitefinity Web Application project
  3. Since Sitefinity still creates the Web Application projects in Visual Studio 2010 format, you will be prompted to upgrade the Sitefinity Web Application project so that it is compatible with Visual Studio 2012.
  4. Once the project has been upgraded, open the Project Properties and change the Target Framework to .NET Framework 4.5.  
  5. This should effectively upgrade your Web.config file to support .NET 4.5.  NOTE: The only difference between ASP.NET 4.5 and ASP.NET 4.0 is the change in the Web.config file.  The IIS Application Pool remains at ASP.NET 4.0.
  6. You can try building and running the application now.  
  7. If you get an error message while running the application about not being able to find SitefinityWebApp.Global, this is because the Global.asax file has not been included in the Visual Studio project.
  8. Right click on the Global.asax file and select Delete.
  9. Right click on the Visual Studio project and select Add New Item.
  10. Add a new Global Application Class to the project.
  11. Build your project once again (NOTE: A re-build may wipe out your DLL references, therefore, DO NOT select this option!!)
  12. Try running your application once again.  If it is successful, you should not have to make any further changes to your Sitefinity Web Application project.
  13. You can now begin leveraging all of the new features available in ASP.NET 4.5 throughout your Sitefinity Web Application!

No comments:

Post a Comment