gpt4 book ai didi

c# - launchProfile.json 中的 "dotnet run"默认配置文件设置是什么?

转载 作者:行者123 更新时间:2023-12-05 09:31:19 24 4
gpt4 key购买 nike

根据 MS 文档: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run?source=docs

和这个 SO 线程 How to determine which environment asp.net core app will run in?

我仍然无法确定 launchProfile.json 中的 dotnet run 默认配置文件设置是什么?

谢谢,彼得

最佳答案

dotnet run --launch-profile "SampleApp"

此方法仅支持现在使用 .NET 6 的 Kestrel 配置文件。例如--launch-Profile 仅支持 "SampleApp",其中 commandName 中定义为 "Project" >launchSettings.json 文件。

{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:59481",
"sslPort": 44308
}
},
"profiles": {
"SampleApp": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7152;http://localhost:5105",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

关于c# - launchProfile.json 中的 "dotnet run"默认配置文件设置是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68889962/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com