- 只能應用在本機開發使用
- 包含 Profile 設定
- 不會進行部屬,publish 時不會產生相對應檔案
Workder Service 建立後 launchSettingss.json 預設內容
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"EnvironmentsSample": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
}
}
}
launchSettings.json 檔案內容的 profile 即為 VS 上選項也可以直接在 launchSettings.json 內建立多個 profile,下述 launchSetting.json 新增 Staging profile
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"EnvironmentsSample": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
},
"Staging": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Staging"
}
}
}
}
除了直接編輯 launchSettings.json 外,VS 上也有提供 UI 介面可以操作
沒有留言:
張貼留言