Reputation: 5366
I have move to using VSCode instead of VS2019 but noticed this error comes up when I run.. It still works.. I just need to keep clicking to ignore the error. Is there some easy fix for this ?
Upvotes: 8
Views: 13263
Reputation: 493
Open the terminal/CLI and run the below command (select the preferred profile - http or https or "IIS Express") from the launchsettings.json
file of your .NET project
dotnet run --launch-profile https
Sample launchSettings.json below
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:62471",
"sslPort": 44313
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5281",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7260;http://localhost:5281",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Upvotes: 4
Reputation: 125197
Follow these steps:
dotnet dev-certs https --trust
and confirm the dialogTo find more information, take a look at:
You may find the following commands useful:
dotnet dev-certs https --clean
dotnet dev-certs https
dotnet dev-certs https --trust
Upvotes: 9