3

Our project files have been around for a while, and they include xmlns="http://schemas.microsoft.com/developer/msbuild/2003">. I'm trying to figure out how to perform a substring match in a CONDITION so I thought I would look at the schema to see if something jumped out at me.

Attempting to fetch the schema results in a 404:

$ wget http://schemas.microsoft.com/developer/msbuild/2003
--2016-10-04 22:44:43--  http://schemas.microsoft.com/developer/msbuild/2003
Resolving schemas.microsoft.com (schemas.microsoft.com)... 65.54.226.187
Connecting to schemas.microsoft.com (schemas.microsoft.com)|65.54.226.187|:80... connected.
HTTP request sent, awaiting response... 404 Not Found

When I visited in a Web Browser, Microsoft returned the following message to me, indicating the schema used to be available but its no longer available:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Microsoft has documentation at MSBuild Project File Schema Reference, but it does not list the schemas available, the schema's URL or the differences between them.

I'm guessing we should not be using the 2003 schema since it appears to be deprecated or withdrawn, but I don't know much more beyond that. My questions are:

  • What schema should we be using?
  • What is the URL to the schema?
  • What are the differences between the 2003 schema and the schema I should be using?

The versions seems to be more relevant now that we are trying to integrate with AppVeyor. We are having problems with automated testing (Can't perform 64-bit testing under AppVeyor? and Why does AppVeyor use VS2010 tools for VS2015 image?), and AppVeyor support is suggesting a change in version numbers in the XML header. Below is the head of a typical VCXPROJ file.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
jww
  • 97,681
  • 90
  • 411
  • 885

1 Answers1

5

The XML Editor for Visual Studio 2015 (maybe other versions as well) provides a cache of schemas locally in %InstallRoot%\Xml\Schemas. Look there for msbuild.xsd.

It would be nice if Microsoft provided it at the namespace URI,

http://schemas.microsoft.com/developer/msbuild/2003

but XML namespace name URIs need not be retrievable. Note that the above namespace URI is still current as of Visual Studio 2015.

Community
  • 1
  • 1
kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • 1
    Thanks @kjhughes, you are right. There is a bunch of stuff in `%InstallRoot%\Xml\Schemas`. Unfortunately, there's no `2003`, `2005`, `2008`, `2010`, etc. Our project's minimum Visual Studio version is VS 2010. What schema should we use with VS2010? I realize I can use the 2003 one, but I'm happy to use one with more features since we have up-converted over the years. – jww Oct 05 '16 at 11:53
  • Use the 2003 one until Microsoft provides a newer one that better suites you. Note, however, that there's a school of thinking that stable namespaces ought not change across versions; you'll see this, for example, in W3C namespaces for HTML (`http://www.w3.org/1999/xhtml`). **The latest version of an XSD does not necessarily correspond to an updated namespace URI.** – kjhughes Oct 05 '16 at 12:55