暫存環境不採用正確的連接字符串。暫存環境不採用正確的連接字符串Asp.Net核心
我有三種環境。開發,分期&發佈。 我的AppSettings看起來像這樣:
{
"Data": {
"DefaultConnection": {
"ConnectionString": "My connection string"
}
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Verbose",
"System": "Information",
"Microsoft": "Information"
}
}
}
我有名字appsettings.Staging.json & appsettings.Release.json兩個文件。 在項目屬性下,我製作了兩個配置文件:分段&發佈女巫都有一個Hosting:Environment,在分段中使用Value Staging進行發佈。它在VS中工作正常,但是當我將它上傳到Azure時,它始終使用我的本地主機連接字符串而不是我的在線數據庫的默認appsettings。 我在做什麼錯?