简体   繁体   English

Aspnet核心2.1.4 IIS启动问题

[英]Aspnet core 2.1.4 IIS start issues

I made a simple POC in AspNet Core 2.1.2 a few days ago without any issue. 我几天前在AspNet Core 2.1.2中做了一个简单的POC而没有任何问题。 I was able to run it either from IIS Express & local IIS (hosted or started/debugged via Visual Studio). 我能够从IIS Express和本地IIS(通过Visual Studio托管或启动/调试)运行它。

I updated the project to the latest AspNet Core 2.1.4 yesterday and cannot seem to run any AspNet Core application in my local IIS now. 我昨天将项目更新到最新的AspNet Core 2.1.4,现在似乎无法在我的本地IIS中运行任何AspNet Core应用程序。

I created a new project (without https) to be sure the migration wasn't the issue. 我创建了一个新项目(没有https),以确保迁移不是问题。

About my environment : 关于我的环境:

Test case : 测试用例 :

  • Created an new "ASP.NET Core Web Application" -> API -> No authentication & no HTTPS 创建了一个新的“ASP.NET核心Web应用程序” - > API - >无身份验证和无HTTPS
  • NetCore version 2.1 NetCore版本2.1

Once the solution is created, running it directly into IIS Express works. 创建解决方案后,直接将其运行到IIS Express中即可运行。 Selecting the other profile named with the application name also works (starts the console and the service correctly) 选择使用应用程序名称命名的其他配置文件也可以正常运行(正确启动控制台和服务)

I then want to host it in my local IIS : 然后我想在我的本地IIS中托管它:

  1. Add a new website with a custom port (5555) and the physical path set to the solution folder (where sits the bin/obj/program.cs/...) 添加一个带有自定义端口(5555)的新网站,并将物理路径设置为解决方案文件夹(其中包含bin / obj / program.cs / ...)
  2. Once created, browsing the site throws me a "Configuration error" : normal, there is no web.config available. 一旦创建,浏览网站就会引发“配置错误”:正常,没有可用的web.config。
  3. I then right-clic on my project in VS, select "Properties" and "Debug" 然后我在VS的项目中右键单击,选择“属性”和“调试”
  4. I Create a new profile as such : Profile 我创建一个新的配置文件: 配置文件
  5. I create a web.config file containing the following (and will be transformed as I change running profile) : Web.config 我创建了一个包含以下内容的web.config文件(并将在我更改运行配置文件时进行转换): Web.config
  6. The project is not "correctly setup" (correctly as my previous POCs with AspNet Core 2.1.2) 该项目没有“正确设置”(正如我之前使用AspNet Core 2.1.2的POC一样)

Issues : 问题:

  • If I try to browse the website through IIS, an error 500 occurs 如果我尝试通过IIS浏览网站,则会出现错误500
  • If I try to debug the solution with the "IIS" profile, an error occurs as such : Startup error 如果我尝试使用“IIS”配置文件调试解决方案,则会发生错误启动错误
  • All the HttpFailure*.html files are empty (0kb) 所有HttpFailure * .html文件都是空的(0kb)
  • There is no error in the event viewer 事件查看器中没有错误
  • There is no error in the IIS log files when enabled 启用后,IIS日志文件中没有错误
  • There is no log file when the parameter stdoutLogEnabled is set to true (except when launched via a profile different than the IIS one, but still, no error) 当参数stdoutLogEnabled设置为true时没有日志文件(除非通过不同于IIS的配置文件启动,但仍然没有错误)

Tests 测试

I tried to : 我试过了 :

  • Restart my computer 重启我的电脑
  • Start VS as administrator 以管理员身份启动VS.
  • Give full permission on the file system where applicable to "Everyone" and the IIS pool user selected 授予适用于“Everyone”和所选IIS池用户的文件系统的完全权限

IIS Express & "console" profile still works. IIS Express和“控制台”配置文件仍然有效。

EDIT1 : I also uninstalled everything and tried to revert to 2.1.2 without success (still with the latest VS) 编辑1:我也卸载了所有内容并尝试恢复到2.1.2但没有成功(仍然使用最新的VS)

I managed to find what was missing : 我找到了遗漏的东西:

In "Windows Features", the following element was not ticked : "Internet Information Services" -> "World Wide Web Services" -> "Common HTTP Features" -> "Http Errors" 在“Windows功能”中,未勾选以下元素:“Internet信息服务” - >“万维网服务” - >“常见HTTP功能” - >“Http错误”

I know it was ticked before installing AspNet Core SDK/bundle, as detailed error pages were served. 知道在安装AspNet Core SDK / bundle之前已经勾选了它,因为提供了详细的错误页面。

Anyway, as soon as this option was enabled again, I was greated with an error stating I cannot override the parameter XXX since it is locked. 无论如何,只要再次启用此选项,我就会收到一个错误,说明我无法覆盖参数XXX,因为它已被锁定。 I had to set it as read/write in the server Feature Delegation. 我不得不在服务器功能委派中将其设置为读/写。

Then all went good. 然后一切顺利。

I cannot imagine the "Http Errors" was restored to an untick value by installing the SDK/bundle and didn't unticked myself (again, local computer). 我无法想象“Http Errors”通过安装SDK / bundle而恢复到一个无法解决的值,并且没有取消我自己(同样是本地计算机)。

I'll put it on the IIS shenanigans tab... 我会把它放在IIS shenanigans选项卡上......

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

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