xsd namespace not found



While working on a WinForms project recently, I was undecided what to call one of my Classes so I called it 'x'. Later when I'd finished the code, I used Resharper to rename the class to 'Settings' as that was a more appropriate name.

However, when I next opened the project, it refused to build and Visual Studio told me there were errors with my .resx files. None of them would open in the designer but I was able to open them using the XML editor.

When I did open them I soon found the problem, the first line should have looked like this:
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

However, everywhere there had previously been an 'x' in an attribute value string in the XML the word 'Settings' now appeared, leaving me with this:
<xsd:schema id="root" Settingsmlns="" Settingsmlns:Settingssd="http://www.w3.org/2001/SettingsMLSchema" Settingsmlns:msdata="urn:schemas-microsoft-com:Settingsml-msdata">

It even changed this:
<xsd:complexType><xsd:choice maxOccurs="unbounded">

To this:
<xsd:compleSettingsType><xsd:choice maSettingsOccurs="unbounded">

But had left the 'xsd' part of the tag name unchanged.

It soon dawned on me what had happened. When I'd used Resharper to rename, there was an option to rename similar things in other files, including things in string literals and comments. I had unthinkingly pressed 'OK' and the result was obviously a consequence of my negligence but the choices of what to replace and what not to replace seem a bit random.


Still, I'll know next time