Visual Studio 2012 XML intellisense broken due to auto-loading duplicate xsd files

p4x0r

New Member
In short: Can I prevent visual studio from loading some xsd's in it's internal intellisense engine? Loading certain xsd's breaks intellisense.To perform input validation on various xml documents, I use xsd. Some of the xsd files I use are standard, such as xml.xsd and various xhtml xsd's. These xsd files are included in a class library as embedded resources.However, having these files in the solution breaks the visual studio intellisense for all kinds of xml files, even in different projects. What seems to be happening is that both visual studio's own xsd files and the "custom" embedded xsd files are loaded, probably since they apply to the same \[code\]targetNamespace\[/code\]. However, this causes lots of warnings such as: \[code\]The global attribute 'http://www.w3.org/XML/1998/namespace:lang' has already been declared.\[/code\] It's particularly annoying for xslt files, but it seems to happen for all xml files that match multiple schemas. XHTML is another particularly problematic case since there are multiple schemas for just one namespace (strict, transitional...). As a consequence, intellisense stops working for the open xml file(s). Also, VS's error list is spammed with lots of spurious warnings, hiding potentially useful warnings from sight.I can disable or remove these schemas using \[code\]XML > Schemas...\[/code\] but this is an unworkable solution since they're all re-added whenever I open a different xml file. I'd have to remove the schemas possibly hundreds of times a day.Is there any way to configure visual studio not to auto-load embedded schemas, or to load only specific schemas once and for all?
 
Back
Top