Michael Knopf

turning concepts into working products...

Error: The default XML namespace of the project must be the MSBuild XML namespace
Author: Michael Knopf
Published: Wednesday, August 25, 2010

One day you get to work, your boss tells you that there is a project that he needs you to work on, you get the code from source control and open the project up in Visual Studio.NET

During project loading you get a series of crazy errors you have never seen before, ultimately ending in:

error : Unable to read the project file '.csproj'. .csproj(2,1): The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.

You scratch your head, with a big thought cloud overhead that reads "WTF???"



You notice that the Silverlight project (in my case the project's called "SilverlightInterface") failed to load and is "unavailable" in Solution Explorer:


So you try to "reload" it by right clicking on the (currently unavailable) project and selecting "Reload Project" from the menu, only to get an even nastier error message:


Looking at the Output Window you're faced with a never-before-seen error which states something about the The default XML namespace of the project must be the MSBuild XML namespace.

Fortunately the solution is simple:

  1. In Windows Explorer navigate to the project
  2. Right Click on the .cproj file, select Properties, and un-check the "Read Only" checkbox
  3. Open up the .cproj file in Notepad
  4. On line 2 change xmlns="http://schemas.microsoft.com/developer/msbuild/2008" to xmlns="http://schemas.microsoft.com/developer/msbuild/2003" (notice this only difference is we changed 2008 to 2003)
  5. Save your changes
  6. In Visual Studio right click on the (currently unavailable) project and select "Reload Project"
  7. The project will now load normally and you can get on with your life

What Others Are Saying: