Register .NET 4.5 IIS 10 Windows 10

荒凉一梦 提交于 2019-12-17 23:24:37

问题


I've been looking at this for a few hours now and I cannot get it fixed.

I have a .NET 4.5 web site and API and I'm working on Windows 10. I have VS2012 Pro installed and VS2015 Community installed.

Checking the Web Platform Installer it states that I already have .NET 4.5 installed.

Everytime I open the API or Web Site solutions it informs me that .NET 4.5 & IIS aren't configured and my applications wont run.

I've tried running these commands as per MS:

dism /online /enable-feature /all /featurename:IIS-ASPNET45

And I still get the some error being reported. Everything I have read states that the above command should fix the issue but it doesn't. I can't find anything else on the topic other than the command listed above.

Seems there are a lot of people with this issue all saying the same thing but no working solution (at least for me so far). .NET 4.5 isn't listed in Add Features to Windows.

How do I get this working so that ASP.NET 4.5 and IIS work?


回答1:


I had the same issues which I have since fixed in VS 2015, my situation was:

  1. Update from Windows 7 --> Windows 10
  2. Installed VS 2015
  3. Enabled IIS so I could then open the management console & do lovely things
  4. I then tried to host a .net 4.5 Web API in my local IIS mentioned above

Result was 404 errors.

To fix:

  1. Open the Developer Command Prompt for VS2015 as Administrator
  2. Run dism /online /enable-feature /all /featurename:IIS-ASPNET45
  3. The operation completed successfully

Lovely 200 responses...




回答2:


Seems this is actually a bug. Despite the command actually working older version of Visual Studio can encounter an issue once .NET 4.6 is installed.

http://blogs.msdn.com/b/webdev/archive/2014/11/11/dialog-box-may-be-displayed-to-users-when-opening-projects-in-microsoft-visual-studio-after-installation-of-microsoft-net-framework-4-6.aspx

Microsoft has published a fix for all impacted versions of Microsoft Visual Studio.

  • VS2013 - https://support.microsoft.com/en-us/kb/2994375
  • VS2012 - https://support.microsoft.com/en-us/kb/3002339
  • VS2010 - https://support.microsoft.com/en-us/kb/3002340



回答3:


To fix:

  1. Open the Developer Command Prompt for VS2015 as Administrator

  2. Run dism /online /enable-feature /all /featurename:IIS-ASPNET45

  3. The operation completed successfully



来源:https://stackoverflow.com/questions/32716434/register-net-4-5-iis-10-windows-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!