Where do I get the 'IgnoreDatabaseOutOfSync' property

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:07:56

问题


I am trying to publish my app to Azure through Visual Studio, but I keep getting the following error:

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

Where can I disable this check by specifying the value of "True" for the MSBuild property "IgnoreDatabaseSettingOutOfSync" ??

Where do I set this property?


回答1:


You'll need to manually edit your .csproj file to set individual MSBuild properties that Visual Studio has no UI for. Usually somewhere near the top of the file there should be a <PropertyGroup> element without a Condition attribute. This group specifies properties that will apply to all configurations (like Debug, Release etc.). You can then add the property to that group:

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

(of. course you can add an additional PropertyGroup, just be sure to do it before the <Import> elements that reference .targets files).

Note that this will suppress the error but the changed database settings may still be dangerous during deployment. (which is why the error exists in the first place)



来源:https://stackoverflow.com/questions/45804014/where-do-i-get-the-ignoredatabaseoutofsync-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!