C# asp.net核心HTTP错误503。服务不可用

C# asp.net核心HTTP错误503。服务不可用,c#,iis,asp.net-core,kestrel,C#,Iis,Asp.net Core,Kestrel,事件查看器显示以下错误 “工作进程未能预加载.Net运行时版本,无托管代码。” “工作进程未能正确初始化,因此无法启动。数据是错误。” 我可以从命令行运行dotnet website.dll并在web浏览器中查看它,但由于某些原因,IIS不运行asp.net核心网站 我已经从这里安装了windows托管dotnet core以及sdk 我已将.net clr版本设置为无托管代码 我将身份更改为管理员,以消除潜在的权限问题 Enable-WindowsOptionalFeature -Onlin

事件查看器显示以下错误

“工作进程未能预加载.Net运行时版本,无托管代码。”

“工作进程未能正确初始化,因此无法启动。数据是错误。”

我可以从命令行运行dotnet website.dll并在web浏览器中查看它,但由于某些原因,IIS不运行asp.net核心网站

我已经从这里安装了windows托管dotnet core以及sdk

我已将.net clr版本设置为无托管代码

我将身份更改为管理员,以消除潜在的权限问题

Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpRedirect
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationDevelopment
Enable-WindowsOptionalFeature -Online -FeatureName NetFx4Extended-ASPNET45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HealthAndDiagnostics
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpLogging
Enable-WindowsOptionalFeature -Online -FeatureName IIS-LoggingLibraries
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestMonitor
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Security
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestFiltering
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Performance
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools
Enable-WindowsOptionalFeature -Online -FeatureName IIS-IIS6ManagementCompatibility
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Metabase
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIExtensions
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic
此外,我不得不将.csproj更改为以下内容,以避免asp.net核心版本之间的冲突

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
  </PropertyGroup>

netcoreapp2.0错误

什么类型的机器?尝试添加
web.config
,是否有任何详细错误?windows server 2016,我添加了一个web.config,但它不生成任何日志,我相信,因为问题是如何让asp.net core主机工作,因为实际的asp.net core网页正在从命令行工作,所以问题在IIS和kestrel之间(我想)在我的例子中,它就像一个管理员同事停止应用程序池一样简单,而该应用程序池正是该站点运行的基础!