发布asp.net核心项目后,iis立即关闭 [英] iis is immediately closed after publishing asp.net core project

查看:150
本文介绍了发布asp.net核心项目后,iis立即关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试调试其下的asp.net核心项目后,IIS Express立即关闭. 我正在使用Visual Studio 2015 Update 3.

IIS Express is immediately closed after i try to debug my asp.net core project under it. i am using visual studio 2015 update 3.

预先感谢

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

my packages are fine but for sake of completness here is 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"目录.

I could reproduce this behaviour and I am pretty sure this is caused by missing .NET Core 1.1 runtime libraries. When you go to C:\Program Files\dotnet\shared\Microsoft.NETCore.App you probably won't see the '1.1.0' directory.

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

Go to https://www.microsoft.com/net/download/core and install the SDK library (select Current and SDK).

如果您确实尝试过(按照我的评论之一建议)删除"type":"platform"行(并添加了runtimes部分(取决于Windows版本)),那么您将看到它不会崩溃.必须安装运行时/SDK.

N.B. If you did try (as I suggested in one of my comments) to remove the "type": "platform" line (and adding the runtimes part (depending on your windows version) then you'll see it won't crash. Without having to install the runtime / SDK.

这篇关于发布asp.net核心项目后,iis立即关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆