[英]Unable to debug ASP.NET 5 using IIS Express with Visual Studio 2015
When I am trying to debug asp.net 5 application in Visual Studio 2015, I am getting following error "An error occurred attempting to determine the process id of the DNX process hosting your application" 当我尝试在Visual Studio 2015中调试asp.net 5应用程序时,我收到以下错误“尝试确定托管应用程序的DNX进程的进程ID时出错”
UPDATE 2 更新2
It is only happening in Windows 10. I tested with Windows 7 and I did not run into this error. 它只发生在Windows 10.我用Windows 7测试过,我没有遇到这个错误。
I am able to run using "web" option in Visual Studio 2015, but the error is happening with IIS Express. 我能够在Visual Studio 2015中使用“web”选项运行,但是IIS Express发生了错误。 When I hit ctrl+F5 (run without debugging), the browser window opens and just sits there doing nothing (cursor spins forever). 当我点击ctrl + F5(没有调试运行)时,浏览器窗口打开,只是坐在那里什么都不做(光标永远旋转)。
The Output -> Debug window is empty, so not sure what is the root cause of this error. 输出 - >调试窗口为空,因此不确定此错误的根本原因是什么。 Not sure if there is anywhere else I have to look for more error details. 不确定是否还有其他地方我需要寻找更多的错误细节。
I have 我有
Microsoft Visual Studio Professional 2015 Version 14.0.25123.00 Update 2
Microsoft .NET Framework Version 4.6.01038
Windows 10 pro v1511 OS build 10586.218
DNVM 1.0.0-rc1-15540
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16609
I even tried dnvm upgrade, which upgraded dnx to dnx-clr-win-x86.1.0.0-rc1-update2, but error is still occurring. 我甚至尝试过dnvm升级,将dnx升级到dnx-clr-win-x86.1.0.0-rc1-update2,但是仍然出现错误。
I tried most of solutions listed in 我尝试了列出的大多数解决方案
An error occurred attempting to determine the process id of the DNX process hosting your application 尝试确定托管应用程序的DNX进程的进程ID时发生错误
and 和
An error occurred attempting to determine the process id of the DNX process hosting your application on clean installed windows 10 + vs2015 尝试确定在干净安装的Windows 10 + vs2015上托管应用程序的DNX进程的进程ID时发生错误
and none of them worked. 而且他们都没有工作。
here is a simple test application if any one wants to look at it. 这是一个简单的测试应用程序,如果有人想看它。 https://github.com/vinodbadugu/aspnet5test https://github.com/vinodbadugu/aspnet5test
launchsettings.json ( UPDATE 1 ) launchsettings.json( 更新1 )
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:44342/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "http://localhost:44342/",
"environmentVariables": {
"Hosting:Environment": "Development"
},
"sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-update2"
},
"web": {
"commandName": "web",
"environmentVariables": {
"Hosting:Environment": "Development"
}
}
}
}
project.json project.json
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
]
}
startup.cs startup.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.Extensions.DependencyInjection;
namespace Tutorial1
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app)
{
app.UseIISPlatformHandler();
app.UseDeveloperExceptionPage();
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
// Entry point for the application.
public static void Main(string[] args) => WebApplication.Run<Startup>(args);
}
}
dnvm list dnvm列表
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-rc1-update1 clr x64 win
1.0.0-rc1-update1 clr x86 win
1.0.0-rc1-update1 coreclr x64 win
1.0.0-rc1-update1 coreclr x86 win
* 1.0.0-rc1-update2 clr x86 win default
1.0.0-rc1-update2 coreclr x86 win
I had the same problems running debugging in IISExpress. 我在IISExpress中运行调试时遇到了同样的问题。 Also on Windows 10. Always getting the "An error occurred attempting to determine the process id of the DNX process hosting your application". 也在Windows 10上。始终收到“尝试确定托管应用程序的DNX进程的进程ID时出错”。 Even for new webapps with no changes and authentication. 即使对于没有更改和身份验证的新webapp也是如此。 Tried all the StackOverflow solutions listed by Vinod above. 尝试了以上Vinod列出的所有StackOverflow解决方案。
What worked for me was installing the recent update of the "Microsoft ASP.NET and Web Tools" (Version 14.1.20512.0 -- dated 5/18/2016 - https://visualstudiogallery.msdn.microsoft.com/c94a02e9-f2e9-4bad-a952-a63a967e3935 ). 对我有用的是安装最新的“Microsoft ASP.NET和Web工具”(版本14.1.20512.0 - 日期为2016年5月18日 - https://visualstudiogallery.msdn.microsoft.com/c94a02e9-f2e9- 4bad-a952-a63a967e3935 )。 The update was literally out the day after I tried almost everything. 在我尝试几乎所有事情后的第二天,这个更新就完全没了。 It even worked for debugging of apps on IISExpress with windows authentication enabled. 它甚至可以在启用Windows身份验证的IISExpress上调试应用程序。
Hope this helps. 希望这可以帮助。
Please edit your launchsettings.json
restart VS and try to Debug again. 请编辑您的launchsettings.json
重新启动VS并再次尝试调试。
{
...
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"Hosting:Environment": "Development"
},
"sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-update2"
},
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.