How to set .net Framework 4.5 version in IIS 7 application pool

.NetVisual StudioIis

.Net Problem Overview


I installed the Visual Studio 11 Beta and suddenly all the async action methods I had created under the VS 11 Developer preview started hanging (apparently this issue: http://blogs.msdn.com/b/pfxteam/archive/2012/03/03/10277166.aspx).

My app is using v4.0.30319 as the Framework Version, but there is no option to use 4.5. I repaired my .net 4.5 install to be sure, but nothing. Is there a way to configure this in IIS? Do I need to bin deploy the files (and if so which)?

.Net Solutions


Solution 1 - .Net

There is no 4.5 application pool. You can use any 4.5 application in 4.0 app pool. The .NET 4.5 is "just" an in-place-update not a major new version.

Solution 2 - .Net

Go to "Run" and execute this:

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir

NOTE: run as administrator.

Solution 3 - .Net

There is no v4.5 shown in the gui, and typically you don't need to manually specify v4.5 since it's an in-place update. However, you can set it explicitly with appcmd like this:

appcmd set apppool /apppool.name: [App Pool Name] /managedRuntimeVersion:v4.5

Appcmd is located in %windir%\System32\inetsrv. This helped me to fix an issue with Web Deploy, where it was throwing an ERROR_APPPOOL_VERSION_MISMATCH error after upgrading from v4.0 to v4.5.

MS article on setting .Net version for App Pool

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGene ReddickView Question on Stackoverflow
Solution 1 - .NetPeter KissView Answer on Stackoverflow
Solution 2 - .NetVitor SousaView Answer on Stackoverflow
Solution 3 - .NetWalterView Answer on Stackoverflow