【发布时间】:2017-02-20 13:09:47
【问题描述】:
我正在构建一个启用 SSL 的 dotnet 核心 APIm。当我尝试运行时,出现以下错误:
尝试确定托管应用程序的 dotnet.exe 的进程 ID 时发生错误。发生了一个或多个错误。
我查看了无数讨论此问题的页面(StackOverflow 和其他),并且我了解它可能发生的主要原因。但是...我几乎可以肯定它们都不是我的问题。
首先,当我关闭 SSL 并尝试在没有它的情况下运行时仍然出现错误。其次,当我经历“修复”或重新安装不同的 dotnet core/iis 的过程时,它可以工作。工作一段时间后,它会停止(我想可能是在 Visual Studio 关闭时)。
我无法找到任何关于它何时开始工作的模式,但我相信它会在 Visual Studio 2015 关闭时停止。
这是我做的一些事情,它们可能会或可能不会暂时起作用:
- 修复 IIS,给我一个 localhost 的 https 证书
- 使用 SSL 地址打开 firefox 或 edge(在没有调试的情况下运行后)以确保其具有证书(或证书豁免)
- 修复/卸载/重新安装 dotnet core
- 从本地用户中删除 IIS Express 文件
请有人给我一些建议,或者帮助找出具体问题的步骤?
在我们升级到 Visual Studio 2017 之前,我可以使用一些替代方法吗?
附加信息:
我有时会使用 VPN
project.json
{
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"AutoMapper": "5.2.0",
"Swashbuckle": "6.0.0-beta902",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.IdentityModel.Tokens": "5.1.2",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.0",
"OpenIddict": "1.0.0-*",
"OpenIddict.EntityFrameworkCore": "1.0.0-*",
"OpenIddict.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel.Https": "1.0.1",
"AspNet.Security.OAuth.Validation": "1.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-*"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"xmlDoc": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config",
"appsettings.json",
"appsettings.production.json",
"appsettings.development.json",
"appsettings.labs.json",
"Resources\\testCert.pfx",
"Resources\\SiteWildcard.pfx"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
- launchSettings.json
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44345/",
"sslPort": 44345
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"App.Api": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
【问题讨论】:
标签: visual-studio asp.net-web-api visual-studio-2015 .net-core iis-express