【问题标题】:How to suppress warnings of type "The Element X in namespace X has invalid child element ..." within Microsoft.CppBuild.targets如何在 Microsoft.CppBuild.targets 中抑制“命名空间 X 中的元素 X 具有无效的子元素 ...”类型的警告
【发布时间】:2012-09-11 14:23:41
【问题描述】:

我有一个非常大的 C# 项目,有 100 多个警告,全部由文件触发:

Microsoft.CppBuild.targets

有没有办法抑制这些类型的警告:

The element 'ResourceCompile' in namespace 
'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 
'MinimalRebuildFromTracking' in namespace 
'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements
expected: 'Culture, PreprocessorDefinitions, UndefinePreprocessorDefinitions,
AdditionalIncludeDirectories, IgnoreStandardIncludePath, ShowProgress,
NullTerminateStrings, SuppressStartupBanner, ResourceOutputFileName' in namespace
'http://schemas.microsoft.com/developer/msbuild/2003'.  C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets 172 10
Miscellaneous Files

其他警告开头为:

The Element 'Midl' ...
The Element 'PropertyGroup' ...
The Element 'Manifest' ...
The Element 'Link' ...
The Element 'ItemGroup' ...
The Element 'ClCompile' ...

环境

  • Visual Studio 2010 SP1
  • 锐化器

【问题讨论】:

    标签: c# visual-studio-2010 .net-4.0


    【解决方案1】:

    解决方案是关闭文件“Microsoft.CppBuild.targets”。

    【讨论】:

    • 基本上是一个小错误。如果在 Visual Studio 中打开,它会验证他们的 XML,但不符合他们的 XML 架构。
    • @tmanthey 很高兴这为您解决了问题。当我们谈到这个话题时,Visual Studio 2012 和 2013 远远领先于 Visual Studio 2010,一旦升级就再也回不去了 :)
    • 完全同意,但在 Visual Studio 2013 中发生在我身上。仍然没有修复。
    • 呃。也许它在 2015 年修复?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-18
    • 2012-04-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多