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:
- In Windows Explorer navigate to the project
- Right Click on the .cproj file, select Properties, and un-check the “Read Only” checkbox
- Open up the .cproj file in Notepad
- 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)
- Save your changes
- In Visual Studio right click on the (currently unavailable) project and select “Reload Project”
- The project will now load normally and you can get on with your life