问题
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