2017-08-21 20 views
0

我想發表我的應用程序通過Visual Studio到Azure,但我不斷收到以下錯誤:我在哪裏可以得到「IgnoreDatabaseOutOfSync」屬性

Severity Code Description Project File Line Error Publish Database Setting Source Verification Error: The connection 'DBConnection' in the publish profile has changed from what is currently declared for 'DBConnection (path_to_my_web.config)'. Because of this publishing has been blocked. If this was intended you can disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync." If this was not intended, open the Publish dialog in Visual Studio with this profile to correct the discrepancy. For more information visit http://go.microsoft.com/fwlink/?LinkId=241526 PhotographyAPI 0

我在哪裏可以通過指定值禁用此檢查MSBuild屬性「IgnoreDatabaseSettingOutOfSync」的「True」?

我在哪裏設置此屬性?

回答

1

您需要手動編輯您的.csproj文件以設置Visual Studio沒有UI的單個MSBuild屬性。通常在文件頂部附近的某個位置應該有一個<PropertyGroup>元素,但不具有Condition屬性。該組指定將應用於所有配置的屬性(如Debug,Release等)。然後,您可以將屬性添加到組:

<PropertyGroup> 
    <IgnoreDatabaseSettingOutOfSync>True</IgnoreDatabaseSettingOutOfSync> 
</PropertyGroup> 

(當然你也可以添加額外的PropertyGroup,只是要確保引用.targets文件<Import>元素之前做到這一點)。

請注意,這將抑制錯誤,但更改後的數據庫設置在部署期間可能仍然很危險。 (這就是爲什麼錯誤首先存在)

相關問題