Run EPiServer CMS 6 on ASP.NET 4.0
Getting EPiServer CMS 6 up and running on ASP.NET 4.0 is easy, although it should be noted that EPiServer doesn't officially support ASP.NET 4.0 yet.
EPiServer 6 on ASP.NET 4
EPiServer doesn’t officially support it yet, but I haven’t found any problems running EPiServer 6 on ASP.NET 4. I haven’t run into the problems Allan Thraen mentioned about edit and admin mode after moving to ASP.NET 4.
Update: Since this post Allan Thraen has announced on EPiServer World that EPiServer 6 now officially supports ASP.NET 4
Change target framework
First, right-click your EPiServer project in Visual Studio and set Target framework to .NET Framework 4:
Next, rebuild the project. If you browse to the website after this you might encounter an exception like:
Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
If so your website is probably not run under ASP.NET 4.0 in IIS and you need to switch application pools (see below).
Run the website under ASP.NET 4.0 in IIS
I’m running IIS 7.5 (part of Windows 7) and in order to have the EPiServer site run under ASP.NET 4.0 I change the application pool to ASP.NET 4.0.
To switch application pools, simply open IIS Manager, right-click the EPiServer website (fittingly called “EPiServer” in my case) and then click Manage Web Site –> Advanced Settings:
Click the button next to Application Pool and select ASP.NET v4.0:
Before clicking OK in the Advanced Settings window you should see an Application Pool setting like the following:
Of course, you could also change frameworks for an existing application pool, or create a new one targeting ASP.NET 4:
Reload the website
You should now be able to browse your website! I got the Public Templates project up and running on ASP.NET 4.0 simply by changing target frameworks, rebuilding, and switching application pools in IIS.