在Visual Studio 2010中使用目标构建时获取大量警告

twe*_*ypi 10 c# build target visual-studio

我正在尝试构建一些代码但在目标文件中收到大量警告,这样的事情:

Warning 12  The element 'ItemGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' 
has invalid child element 'TCS_Compile' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. 
List of possible elements expected: 
'Item, Reference, COMReference, COMFileReference, Xdcmake, Bscmake, ClCompile,
 ClInclude, Midl, ResourceCompile, PreLinkEvent, CustomBuildStep, Manifest, 
ProjectConfiguration, NativeReference, ProjectReference, Compile, EmbeddedResource, 
Content, Page, Resource, ApplicationDefinition, None, BaseApplicationManifest, 
Folder, Import, Service, WebReferences, WebReferenceUrl, FileAssociation, 
BootstrapperFile, PublishFile, CodeAnalysisDependentAssemblyPaths, 
CodeAnalysisDictionary, CodeAnalysisImport, Link, ResourceCompile, PreBuildEvent, 
PostBuildEvent' 
in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'.
Run Code Online (Sandbox Code Playgroud)

我有什么想法可以解决这些问题吗?

Tom*_*ell 15

我也有这个问题.经过一些谷歌搜索,发现建议关闭VS中的所有编辑器窗口,然后重建.

为我工作.


Art*_*ius 10

来自[死链接]的信息......

您可以放心地忽略此警告.那么MSBuild是否根据模式验证您的项目文件?是的确如此,但我不确定它是如何完成的,所以我向Buck Hodges发了一封电子邮件.他很擅长在MSBuild团队中传递一个尚未命名的开发者.开发者说

" ...的MSBuild并尝试来验证模式.但是,验证在运行时由我们的代码完成,而不是使用验证读取器与XSD(主要用于PERF原因)加载[项目]文件.应的MSBuild任何失败那些不遵守架构的项目."

所以你有它.强制执行模式,同时仍允许您自定义和扩展MSBuild项目文件以满足您的需要.