在哪里获取"IgnoreDatabaseOutOfSync"属性 [英] Where do I get the 'IgnoreDatabaseOutOfSync' property

查看:90
本文介绍了在哪里获取"IgnoreDatabaseOutOfSync"属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Visual Studio将应用程序发布到Azure,但始终出现以下错误:

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

严重性代码描述项目文件行 错误发布数据库设置源验证错误:发布配置文件中的连接"DBConnection"已与当前为"DBConnection(path_to_my_web.config)"声明的连接已更改.因此,此发布已被阻止.如果打算这样做,则可以通过为MSBuild属性"IgnoreDatabaseSettingOutOfSync"指定"True"的值来禁用此检查.如果不希望这样做,请使用此配置文件在Visual Studio中打开发布"对话框以更正差异.有关更多信息,请访问 http://go.microsoft.com/fwlink/?LinkId=241526 PhotographyAPI 0

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"的值来禁用此检查?

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

我在哪里设置此属性?

Where do I set this property?

推荐答案

您需要手动编辑.csproj文件,以设置Visual Studio没有UI的单个MSBuild属性.通常,在文件顶部附近的某个地方应该有一个<PropertyGroup>元素,但没有Condition属性.该组指定将应用于所有配置的属性(例如Debug,Release等).然后,您可以将该属性添加到该组:

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>

(当然,您可以添加其他PropertyGroup,只需确保在引用.targets文件的<Import>元素之前执行此操作)即可.

(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)

这篇关于在哪里获取"IgnoreDatabaseOutOfSync"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆