简体   繁体   English

全新Windows 10安装-IIS 10-现有MVC应用程序无法正常运行

[英]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. 今天早上,我在开发机上安装了Windows 10的新副本。 After the install, I installed IIS 10 (Selected all options), and then I started my Visual Studio 2015 Pro Installation. 安装之后,我安装了IIS 10(选择了所有选项),然后开始了Visual Studio 2015 Pro安装。

After setting everything, I can't get my existing ASP.NET 4.5 MVC Application to run. 设置完所有内容后,我无法运行现有的ASP.NET 4.5 MVC应用程序。 The application is configured to use Local IIS, and not IIS Express. 该应用程序被配置为使用本地IIS,而不是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). (过去,我使用较旧的Windows版本已经做了很多次,没有问题)。

My IIS application uses an AppPool called "home". 我的IIS应用程序使用一个名为“ home”的AppPool。 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. 我已将AppPool分配给该应用程序,并且还向以下用户授予了文件夹权限:“ IIS AppPool \\ home”,NETWORK SERVICES,IIS_USRS。

For the LOVE OF GOD, I cannot get the application to run, I get the following error: 对于LOVE OF GOD,我无法运行该应用程序,但出现以下错误:

HTTP Error 500.19 - Internal Server Error HTTP错误500.19-内部服务器错误

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 配置文件:\\?\\ C:\\ Workspace \\ Git \\ Source \\ MyHomeApp \\ web.config

Config Source: 配置源:
-1: 0: -1:0

That's the full message, nothing else. 这就是全部信息,仅此而已。 I double checked my .config file, its fine, no dodgy characters. 我仔细检查了.config文件,它很好,没有狡猾的字符。 When I switch the application to IIS Express, it works perfectly. 当我将应用程序切换到IIS Express时,它可以完美运行。 So it seems im missing some IIS configuration! 因此,似乎我缺少一些IIS配置!

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!!! 有趣的是:当我在VS2015中创建一个新的ASP.NET MVC 4.5 Web应用程序时,我进入了项目的属性并将其设置为使用本地IIS,那么新的应用程序就可以工作了!!!

So I've established two things: 因此,我确定了两件事:

  1. IIS works fine with ASP.NET 4.5 applications (All components installed etc..) IIS可与ASP.NET 4.5应用程序正常工作(已安装所有组件等)
  2. There is nothing wrong with my HOME application web.config file, as tested using IIS Express it works just fine. 我的HOME应用程序web.config文件没有问题,正如使用IIS Express进行的测试所显示的那样,它工作正常。

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). 我将旧IIS服务器上的ApplicationHost.config与Windows 10上的ApplicationHost.config进行了比较,我注意到缺少IIS模块,其中一个尤其是%SystemRoot%\\ system32 \\ inetsrv \\ rewrite.dll(URL重写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. 我注意到,在IIS重置后几乎没有加载该页面,这有点奇怪,它会立即报告一个错误,这使我想到了mmm,它立即拒绝了访问。 Anyway, spent 5 hours on this :( 无论如何,花了5个小时:(

I had the same problem on 1709 Creator's Update just this 2017 fall, but I solved it by a different approach: 就在2017年秋天,我在1709年创作者更新中遇到了相同的问题,但是我通过另一种方法解决了这个问题:

In the Windows features for IIS, the following were disabled (unticked): 在IIS的Windows功能中,禁用了以下功能(未选中):

  • IIS IIS
  • WWW services 万维网服务
  • Application Development Features 应用程序开发功能
  • .NET 3.5 and 4.7 .NET 3.5和4.7

Enabling them solved this 500.19 error. 启用它们可以解决此500.19错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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