Dom*_*see 101 c# asp.net-core
我在尝试启动应用程序时收到此错误消息.
尝试确定托管应用程序的DNX进程的进程ID时发生错误
有没有办法解决这个问题?
Fro*_*rud 151
对我来说,问题是通过关闭Visual Studio,删除来解决的
project.lock.json
Run Code Online (Sandbox Code Playgroud)
并再次启动Visual Studio.
编辑:我正在使用RC1.
Dom*_*see 34
在project.json
更换的依赖
"Microsoft.AspNet.Server.IIS":"1.0.0-beta7"
同
"Microsoft.AspNet.Server.Kestrel":"1.0.0-beta8"
在web.config
该handlers
部分中删除除了之外的所有条目
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
Run Code Online (Sandbox Code Playgroud)
完整web.config
将如下所示:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
RC1:使用RC1时,移动解决方案文件夹后出错.删除bin
和obj
文件夹后,一切工作再次.
正如user764754所指出的,只需重启Visual Studio也可以提供帮助.
小智 30
对于遇到此问题的其他人,在其他解决方案不起作用的情况下 - 我在此主题中找到答案: 强制使用SSL:尝试确定托管应用程序的DNX进程的进程ID时发生错误
我的项目使用或强制执行SSL而不先调试(CTRL + F5),它会要求您生成本地SSL证书,之后调试将起作用并且错误将消失.
小智 11
对于它的价值,这是一个通用错误消息,可以作为httpPlatformHandler无法启动给定可执行文件(在本例中为dnx)的任何问题的红色鲱鱼.
在我的情况下,我收到此错误是由于误解了launchSettings.json文件的直接结果.我试图为我的应用程序启用https端点,并错误地复制了我的applicationUrl中的sslport.据我所知,applicationUrl应该是应用程序的http主机名/端口,通过填写sslPort,它只是配置IIS Express环境来监听sslPort中提供的端口上applicationUrl中给出的主机名上的https.
例如:
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:44000",
"sslPort": 44300
}
}
Run Code Online (Sandbox Code Playgroud)
在localhost上提供以下两个端点.
如果您在applicationUrl和sslPort设置中具有相同的端口,则会收到与此线程关联的错误.
在RC1上我也是如此
小智 6
有可能升级,我发现我必须在这里查看新的更新模板.
更新wwwroot中的web.config以包含:
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
Run Code Online (Sandbox Code Playgroud)
您还需要 通过修改project.json 来更改项目使用Kestrel进行调试的方式:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-beta8",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
}
Run Code Online (Sandbox Code Playgroud)
并修改您的hosting.ini
server=Microsoft.AspNet.Server.Kestrel
Run Code Online (Sandbox Code Playgroud)
并将其添加到startup.cs中的Configure方法
// Add the platform handler to the request pipeline.
app.UseIISPlatformHandler();
Run Code Online (Sandbox Code Playgroud)
添加这些引用应该允许您运行该项目.
由于项目配置尝试启动https:// localhost而不是http,我遇到了这个问题.右键单击webproject,在"Debug"下,将"App URL"调整为http而不是https.
解决这个问题的另一种方法是将启动器从"IIS Express"切换到"Web"