简体   繁体   中英

Fresh Windows 10 Install - IIS 10 - Existing MVC App not working

I've been spending all day to get this working but with no luck :( Hopefully someone can help.

I installed a fresh copy of Windows 10 on my dev machine this morning. After the install, I installed IIS 10 (Selected all options), and then I started my Visual Studio 2015 Pro Installation.

After setting everything, I can't get my existing ASP.NET 4.5 MVC Application to run. The application is configured to use Local IIS, and not IIS Express. I have configured the Virtual Directly, and I believe I have granted all the permissions. (I have done this many times in the past with older Windows versions, had no issues).

My IIS application uses an AppPool called "home". I have assigned the AppPool to the application, and have also granted folder permission to the following users: "IIS AppPool\\home", NETWORK SERVICES, IIS_USRS.

For the LOVE OF GOD, I cannot get the application to run, I get the following error:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Config File: \\?\\C:\\Workspace\\Git\\Source\\MyHomeApp\\web.config

Config Source:
-1: 0:

That's the full message, nothing else. I double checked my .config file, its fine, no dodgy characters. When I switch the application to IIS Express, it works perfectly. So it seems im missing some IIS configuration!

What's interesting is: When I create a new ASP.NET MVC 4.5 web application within VS2015, and I go into properties of the project and set it to use Local IIS, then the new application works!!!

So I've established two things:

  1. IIS works fine with ASP.NET 4.5 applications (All components installed etc..)
  2. There is nothing wrong with my HOME application web.config file, as tested using IIS Express it works just fine.

I give up... hope someone can help!

I SOLVED IT!!!

It's ridiculous how wrong Microsoft is with there error code reporting, it completely screwed me over.

I compared the ApplicationHost.config on my old IIS server to the one on Windows 10, and I noticed that there are missing IIS Modules, the one in particular was %SystemRoot%\\system32\\inetsrv\\rewrite.dll (URL Rewrite 2.0). I noticed it was kinda strange that the page hardly loaded after an IIS reset, it would just report an error immediately, this made me think mmm, its denying access right away. Anyway, spent 5 hours on this :(

I had the same problem on 1709 Creator's Update just this 2017 fall, but I solved it by a different approach:

In the Windows features for IIS, the following were disabled (unticked):

  • IIS
  • WWW services
  • Application Development Features
  • .NET 3.5 and 4.7

Enabling them solved this 500.19 error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM