views:

83

answers:

2

In TFS 2008, I am trying to modify a build script (TFSBuild.proj). I get the following warning:

The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'TeamProject' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'.

Which is correct, The element PropertyGroup does indeed have a child called TeamProject.

I’m making an assumption that this is caused because of the following line:

<Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

The Xml Namespace doesn’t appear to exist as far as I can tell, although it looks like a standard one. Please can anyone tell me if this is a standard XML namespace, how or where I can view its contents and whether the warning that I am seeing may be caused by it?

+2  A: 

You're editing A SCRIPT file in Visual Studio editor, it will always try to find missing elements in the namespaces. I have the same "infos" (not errors) when I'm using custom tasks or custom libraries. The best way to solve it is to get used to it:). Remember these are only warnings from the editor.

Leszek Wachowicz
Thanks for that. I realise that what I am seeing it not an error, but I was curious as to where the namespace that I mentioned came from, where / how it's viewable and whether it caused the message. Before I can get used to something, I have to understand it.
pm_2
A: 

Here's the answer for your question: http://sstjean.blogspot.com/2007/04/visual-studio-warning-element-in.html

Hope this helps.

and here's the Solution:)

Solution:

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."
Leszek Wachowicz