gpt4 book ai didi

c# - asp.net core项目发布后iis立即关闭

转载 作者:行者123 更新时间:2023-11-30 14:48:44 25 4
gpt4 key购买 nike

在我尝试在其下调试我​​的 asp.net 核心项目后,IIS Express 立即关闭。我正在使用 visual studio 2015 update 3。

提前致谢

我的包很好,但为了完整起见,这里是 project.json:

 "dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-preview1-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.1.0": {
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},

"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},

"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}

这是我的启动类:

  loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseMvc();

最佳答案

我可以重现此行为,我很确定这是由于缺少 .NET Core 1.1 运行时库造成的。当您转到 C:\Program Files\dotnet\shared\Microsoft.NETCore.App 时,您可能看不到“1.1.0”目录。

转到 https://www.microsoft.com/net/download/core安装 SDK 库(选择当前和 SDK)。

注意如果您确实尝试(正如我在我的一条评论中所建议的那样)删除 "type": "platform"行(并添加运行时部分(取决于您的 Windows 版本),那么您会发现它不会崩溃。没有必须安装运行时/SDK。

关于c# - asp.net core项目发布后iis立即关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40701879/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com