[英]Getting lots of warnings when building with targets in Visual Studio 2010
I'm trying to build some code but getting lots of warnings in target files, stuff like this: 我正在尝试构建一些代码但在目标文件中收到大量警告,这样的事情:
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'.
Any ideas how I could fix these? 我有什么想法可以解决这些问题吗?
I had this problem too. 我也有这个问题。 After some googling, found a suggestion to close all the editor windows in VS, and then rebuild. 经过一些谷歌搜索,发现建议关闭VS中的所有编辑器窗口,然后重建。
Worked for me. 为我工作。
Info from [dead link]... 来自[死链接]的信息......
You can safely ignore this warning. 您可以放心地忽略此警告。 So does MSBuild validate your project files against the schema? 那么MSBuild是否根据模式验证您的项目文件? Yes it does, but I wasn't sure just how it was accomplished, so I fired off an email to Buck Hodges. 是的确如此,但我不确定它是如何完成的,所以我向Buck Hodges发了一封电子邮件。 He was nice enough to pass it by an as-yet-unnamed-dev on the MSBuild team. 他很擅长在MSBuild团队中传递一个尚未命名的开发者。 The dev stated that 开发者说
"...MSBuild does try to validate against the schema. However, the validation is done at runtime by our code rather than loading the [project] file using a validate reader with the xsd (mainly for perf reasons). MSBuild should fail any projects which don't adhere to the schema." “... MSBuild确实尝试对模式进行验证。但是,验证是在运行时由我们的代码完成的,而不是使用带有xsd的验证读取器加载[project]文件(主要是出于性能原因).MSBuild应该失败任何那些不遵守架构的项目。“
So there you have it. 所以你有它。 The schema is enforced while still allowing you to customize and extend the MSBuild project file to fit your needs. 强制执行模式,同时仍允许您自定义和扩展MSBuild项目文件以满足您的需要。
Another warning of my project had cause the xml to open in VS editor, which promptly displays a bunch of these warnings, even though the xml is not even close to being in the same project. 我的项目的另一个警告导致xml在VS编辑器中打开,即使xml甚至不在同一个项目中,它也会立即显示一堆这些警告。 Closing the file in the environment will remove the warnings. 关闭环境中的文件将删除警告。 They can be ignored otherwise. 否则他们可以被忽略。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.