使用的就是官方的api例子:代码未做任何改变
其中launchSetting.json配置为:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:1212",
"sslPort": 9988
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"nativeDebugging": false,
"jsWebView2Debugging": false
},
"WebApplication3": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": "true",
"applicationUrl": "https://localhost:5201;http://localhost:5000"
}
}
}
参考 https://stackoverflow.com/a/59186591 :
the SSL port must be between 44300 and 44399.
还是一样的
@我本梁人: 再提供一篇参考博文:8 ways to set the URLs for an ASP.NET Core app,其他帮不上了