206

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)?

Gene Reddick
  • 4,655
  • 4
  • 34
  • 35
  • 6
    Link to .Net 4.5 install for servers, in case anyone lands here looking for it: http://www.microsoft.com/en-us/download/details.aspx?id=30653 – Chris Moschini Sep 07 '12 at 07:54
  • 2
    Offline .NET Framework 4.5.1 installer: http://www.microsoft.com/en-us/download/details.aspx?id=40779 – Peter Kiss Dec 13 '13 at 20:38
  • 2
    .NET 4.5.2: http://www.microsoft.com/en-us/download/details.aspx?id=42642 | Lang packs: http://www.microsoft.com/en-us/download/details.aspx?id=42641 – Peter Kiss May 07 '14 at 19:47
  • 1
    .NET 4 and .NET 4.5 (including 4.5.1 and 4.5.2) are on the CLR version 4.0 >>> More detail: https://msdn.microsoft.com/en-us/library/8bs2ecf4(v=vs.110).aspx – VnDevil Sep 18 '15 at 08:40

3 Answers3

385

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.

Peter Kiss
  • 9,309
  • 2
  • 23
  • 38
  • Thanks. I suspected as much, though unclear why the async calls are failing. I'll put that in a different question. – Gene Reddick Mar 04 '12 at 23:05
  • 2
    I have a 4.5 application pool in IIS after installing Visual Studio 2012 and 4.5, and Windows 8 – Brian Mains Jan 22 '13 at 01:34
  • 30
    Yes the Apppool has the name ".NET v4.5" but check the .NET Framework version column in IIS - Application pools screen, it will be 4.0. (There are 3 base CLR: 1.0, 2.0, 4.0.) – Peter Kiss Jan 22 '13 at 11:32
  • What's going on here? I do not have 4.5 listed as a framework version yet this SO QA says there's a new CLR, contrary to Peter http://stackoverflow.com/questions/8810391/will-net-4-5-introduce-a-new-version-of-the-clr – Luke Puplett Nov 07 '13 at 10:58
  • 4
    http://msdn.microsoft.com/en-us/library/bb822049(v=vs.110).aspx - Features and IDE section; it's not a new CLR – Peter Kiss Nov 07 '13 at 13:42
  • @Microsoft Cause thats not at all confusing ! – bumble_bee_tuna Jan 21 '14 at 17:25
36

Go to "Run" and execute this:

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

NOTE: run as administrator.

Raj Kamal
  • 577
  • 6
  • 15
Vitor Sousa
  • 461
  • 4
  • 8
  • just wanted to say thanks, so happy I finally found this solution – Jordan Wayne Crabb Feb 11 '16 at 22:56
  • My App reminds me of not finding .net Framework 4.5 when I try to run it with VS 2015. After execute this command, it works like a charm. Thank you. Remember run as Administrator on CMD. – Nijat2018 Sep 16 '16 at 12:41
19

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

Walter
  • 1,855
  • 18
  • 29
  • 1
    When installing IIS before installing ASP.Net 4.5 or 4.0 you can face a missing registration in the metabase. Using aspnet_regiis can help reset IIS serverwide, but note that it will upgrade all application pools to the selected version. – Jan Hebnes Aug 11 '15 at 09:50
  • The appcmd does change the app pool to 4.5 and you can see that in iisadmin. But then you can't debug from devstudio 2022. Says it can start the server. – dcarl661 Jul 18 '22 at 23:32