Closed Edward-Zhou closed 5 years ago
The local system account uses a different certificate store. The dev cert isn't intended for that scenario. You should create a certificate, deploy it with the app, and load it directly.
@guardrex that https link in Windows Services is misleading them.
I follow this document Host ASP.NET Core in a Windows Service. After starting the service with
sc start MyService
, it only works for http, it did not redirect to https as this document indicates.Then I try to configure the urls directly by
return WebHost.CreateDefaultBuilder(args) .ConfigureAppConfiguration((context, config) => { // Configure the app here. }) .UseUrls("http://localhost:5000","https://localhost:5001")
The service will fail to start, and check the application log, it says that it fail to find the asp.net core dev certificate.My current solution is running the service under my own user account.
But, I am wondering how to run the service under
local system account
. I already check asp.net core dev certificate is installed underComputer/Personal
store.Is there anything could be done from aspnet/Hosting or we should add more description on the Host ASP.NET Core in a Windows Service