c# - 我在哪里可以获得 'IgnoreDatabaseOutOfSync' 属性

标签 c# azure visual-studio-2015 msbuild azure-web-app-service

我尝试通过 Visual Studio 将应用程序发布到 Azure,但不断收到以下错误:

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

我在哪里设置这个属性?

最佳答案

您需要手动编辑 .csproj文件来设置 Visual Studio 没有 UI 的各个 MSBuild 属性。通常在文件顶部附近应该有一个 <PropertyGroup>没有 Condition 的元素属性。该组指定将应用于所有配置(如调试、发布等)的属性。然后您可以将该属性添加到该组中:

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

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

请注意,这将抑制错误,但更改的数据库设置在部署期间可能仍然存在危险。 (这就是错误存在的原因)

关于c# - 我在哪里可以获得 'IgnoreDatabaseOutOfSync' 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45804014/

相关文章:

c# - 我怎样才能制作一个按钮,将剪贴板上的内容粘贴到任何位置?

c# - 如果使用接口(interface),类是否应该始终严格实现接口(interface)

c# - 从母版页的代码后面访问 RadEditor 控件...当它存在时找不到任何 radEditor 控件...有什么问题吗?

c# - MSB4057 : The target "pipelinePreDeployCopyAllFilesToOneFolder" does not exist in the project

azure - 如何在Azure Web App盒子上执行appcmd?

c# - 查找第一个属性不是 'title' 的所有 <a> 标签

c# - 如何使用 Word Automation 在段落中添加下标字符?

c# - 日期时间在转换时出错

sql - 数据从 CSV 导入到 SQL Azure 数据库

c++ - OpenCV 错误 : Assertion failed using calcHist