开发者

XML/XSD intellisense not working in Visual Studio 2010

I am working on xml and xsd files in VS 2010 but intellisense isn't working. Intellisense is working for the same files in VS 2008, however.

When I type '<xs:' o开发者_JS百科ptions like "attribute", "complexType", "simpleType", or "element" do not appear.

Is there some difference between the VS 2008 and VS 2010 that I'm missing?

I add an xsd file to my solution. All the proper namespaces are generated automatically as such:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="XMLSchema2"
    targetNamespace="http://tempuri.org/XMLSchema2.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/XMLSchema2.xsd"
    xmlns:mstns="http://tempuri.org/XMLSchema2.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

</xs:schema>

The "xsdschema.xsd" is in the "C:\Program Files\Microsoft Visual Studio 10.0\xml\Schemas" directory.

There is a check mark in the "Use" column in the XML Schemas dialog box.


I discovered what happened. Visual Studio 2010 imported the schemas from Visual Studio 2008. This caused duplication warnings like the one below:

Warning The global attribute 'http://www.w3.org/XML/1998/namespace:lang' has already been declared. C:\Program Files\Microsoft Visual Studio 10.0\xml\Schemas\xml.xsd   

In the XML Schemas dialog, I removed the old ones from the schema cache. You'll have to restart Visual Studio.


The intellisense and schema validation will disappear if there are warnings not been resolved; like having duplicate complex types defines in different files withing the same schema namespace.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜