I am build a dotnet core APIm which has SSL enabled. When I try to run I get the following error:
An error occurred attempting to determine the process id of dotnet.exe which is hosting your application. One or more errors occurred.
I have looked at countless pages (StackOverflow and others) that talk about this issue, and I understand the main reasons it can happen. But... I am almost certain none of them are my issue.
Firstly, when I turn off SSL and try to run without it still errors. Secondly, when I go through a process of "repairing" or reinstalling different dotnet core/iis express things it works. After working for some time, it will stop (I think possibly when Visual Studio is closed).
I have been unable to find any pattern as to when it starts working, but I believe it stops when Visual Studio 2015 closes.
Here are a few things I do, which may or may not get it temporarily working:
- Repair IIS, giving me a https certificate for localhost
- Open firefox or edge with the SSL address (after running without debug) to make sure it has certificate (or certificate exemption)
- Repair/uninstall/reinstall dotnet core
- Remove IIS Express files from local user
Please could somebody possibly give me either some suggestions for what it could be, or steps to help find out what the specific issue is?
Alternatively some kind of work around that I can use until we upgrade to Visual Studio 2017?
Additional information:
I sometimes use a 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"
}
}
}
}