Anyone ever seen this error? It’s happening seemingly out of nowhere in a .net 3.5 Web app project that instantiates this namespaces object for use in xml serialization. I have cleaned and tried to rebuild the solution, checked and reset references to System.Xml. This is in code that has not been touched in over a year. The project was recently upgraded to .net 3.5 but has been through at least two build cycles since the upgrade without issue. Any ideas?
Here is the guidance MS provides
Some code:
Dim serializerNamespaces As New System.Xml.Serialization.XmlSerializerNamespaces()
serializerNamespaces.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance")
This issue came up again and thought I’d document it here for future reference. The cause was that SvcUtil.exe was used to generate a proxy for a WCF service call, and in doing so it created a partial class in the same .NET namespace that was being used in another class. In this case the partial class is not being used so just commented out the generated class and issue solved.