如何确保我的 Application.Blazor 项目在我的默认 Chrome 浏览器中运行并具有我的所有首选设置?我需要在 launchSettings.json 文件中进行任何特定设置吗?
我的午餐设置.Json 文件
{
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5022"
},
"https": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7272;http://localhost:5022"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:1318/",
"sslPort": 44381
}
}
}
我测试了 Visual Studio 2022 中的 BrowserWith 设置以及 launchSettings.json 文件中的
preferredBrowser
设置,还尝试了一系列其他设置,但没有效果。
您可以使用参数将新的 chrome 浏览器实例添加到 Visual Studio 并添加
--profile-directory=Default
或
--profile-directory="Nameofyourprofile"