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?
Info from [dead link]...
You can safely ignore this warning. So does MSBuild validate your project files against the schema? Yes it does, but I wasn't sure just how it was accomplished, so I fired off an email to Buck Hodges. He was nice enough to pass it by an as-yet-unnamed-dev on the MSBuild team. 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."
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.