首页 新闻 会员 周边

aspnetcore 在iis中启动 打开连接出现 An error occurred while starting the application

0
[已解决问题] 解决于 2016-09-08 13:31

aspnetcore 在iis中启动 打开连接出现 An error occurred while starting the application

 

win 10 装了  .NET Core Windows Server Hosting    

program.cs   中

var host = new WebHostBuilder()
.UseKestrel()
.UseUrls("http://*:8001")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

host.Run();

 

web 根目录 是  vs  发布后的根目录

丁松松松的主页 丁松松松 | 初学一级 | 园豆:112
提问于:2016-09-01 14:38
< >
分享
最佳答案
0

IIS的电脑上有没有安装.NET Core SDK?

奖励园豆:5
dudu | 高人七级 |园豆:30943 | 2016-09-01 15:12

 装了的    我在 本地 也出现这个错误  win 10系统

丁松松松 | 园豆:112 (初学一级) | 2016-09-01 15:14

@丁松松松: web.config中<system.webServer>部分的配置是什么?

dudu | 园豆:30943 (高人七级) | 2016-09-01 15:20

@dudu: 

<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\BetterNutritionDotNetCore.Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
<httpErrors errorMode="Detailed" />

丁松松松 | 园豆:112 (初学一级) | 2016-09-01 15:35

@丁松松松:
试试设置stdoutLogEnabled="true",然后看看.\logs\stdout中的错误日志

dudu | 园豆:30943 (高人七级) | 2016-09-01 15:38

@dudu: 这个问题解决了  但是出现  502.5 错误   

  • The application process failed to start
  • The application process started but then stopped
  • The application process started but failed to listen on the configured port
丁松松松 | 园豆:112 (初学一级) | 2016-09-01 15:48

@丁松松松: 把端口换成5000试试

dudu | 园豆:30943 (高人七级) | 2016-09-01 15:49

@dudu: 通过  事件查看器  发现   错误   Failed to start process with commandline '"%LAUNCHER_PATH%" %LAUNCHER_ARGS%', ErrorCode = '0x80070002'.

丁松松松 | 园豆:112 (初学一级) | 2016-09-01 16:08

@dudu: 这个该怎么解决呢

丁松松松 | 园豆:112 (初学一级) | 2016-09-01 16:16

@丁松松松: 从这个错误看,IIS中用到的web.config不对,不是你之前回复中的web.config。

dudu | 园豆:30943 (高人七级) | 2016-09-01 16:19

@丁松松松:
IIS现在用的是

<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>

正确的应该用:

<aspNetCore processPath="dotnet" arguments=".\BetterNutritionDotNetCore.Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
dudu | 园豆:30943 (高人七级) | 2016-09-01 16:21

@dudu: 我把web 目录设置成 PublishOutput 文件夹  发现  stdout 中 记录到 path 错误 其中 重复了 bin\Release\PublishOutput   然后 我把  web目录 设置成 web项目的文件夹   就报  commandline 错误,因为  当前目录下  web.config 中 并不是  发布 生成的  web.config  里面 命令 和参数 都是 错的 ,请问  我怎么  才能 搞定 那个 path 错误  这样 我可以 把web 目录 设置成 PublishOutput 文件夹  这样应该不会有问题了

丁松松松 | 园豆:112 (初学一级) | 2016-09-01 16:51

@丁松松松: 这个问题你自己应该可以搞定

dudu | 园豆:30943 (高人七级) | 2016-09-01 17:00

@dudu: 重启解决问题 。。。

丁松松松 | 园豆:112 (初学一级) | 2016-09-02 10:32
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册