当我尝试在 Visual Studio 2015 中调试 asp.net 5 应用程序时,出现以下错误“尝试确定托管应用程序的 DNX 进程的进程 ID 时发生错误”
更新 2
它只发生在 Windows 10 中。我使用 Windows 7 进行了测试,但没有遇到此错误。
我可以在 Visual Studio 2015 中使用“web”选项运行,但 IIS Express 发生错误。当我按 ctrl+F5(不调试运行)时,浏览器窗口打开,只是坐在那里什么都不做(光标永远旋转)。
输出 -> 调试窗口是空的,所以不确定这个错误的根本原因是什么。不确定是否还有其他地方我必须寻找更多错误详细信息。
我有
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
我什至尝试过 dnvm upgrade,将 dnx 升级为 dnx-clr-win-x86.1.0.0-rc1-update2,但仍然出现错误。
我尝试了中列出的大多数解决方案
尝试确定托管您的应用程序的 DNX 进程的进程 ID 时发生错误
和
尝试确定在干净安装的 Windows 10 + vs2015 上托管您的应用程序的 DNX 进程的进程 ID 时发生错误
他们都没有工作。
如果有人想看,这里有一个简单的测试应用程序。 https://github.com/vinodbadugu/aspnet5test
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"
}
}
}
}
项目.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"
]
}
启动.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 列表
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