Click here to Skip to main content
15,894,284 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am redesigning my company's website. Because so much is getting rewritten, I decided to upgrade from .Net 2.0 to 3.5 (the most recent version we have.) Since the change was made, I have been getting a persistent warning in VS 2008: Errors occured while compiling the Xml schemas in the project. Because of this, Xml intellisense is not available.

I have several schemas, all located in App_Data. The warning references the first schema in the directory list. Renaming that schema (and so making no longer first) causes the warning to still appear, now referencing the new first schema. I have even used VS 2008 to create a new schema; when it is the first on the list, it will be the one referenced in the warning. (One of my custom schemas and the untouched generated schema appear below.)

There is no specific line or column to the warning, and running the schema through a validator shows it to be properly formatted and referenced. IntelliSense still works fine when making edits to the schema. When the schema is referenced by an XML file, IntelliSense works fine with the custom schema. The problem is not with the XML file itself; the warning appears even when the schema is not being referenced.

The schemas worked just fine before converting the site to 3.5. It is driving me crazy, having this warning. Any suggestions of how to get rid of it? (Other than eliminating the schemas entirely, that is.)

XML
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    attributeFormDefault="unqualified"
    elementFormDefault="qualified">

    <xs:element name="Item">
        <xs:complexType>
            <xs:attribute name="key" type="xs:string" use="required"/>
            <xs:attribute name="value" type="xs:string" use="required"/>
            <xs:attribute name="tag" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="DataStore">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Item" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="rootPath" type="xs:string" use="required"/>
            <xs:attribute name="description" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>

</xs:schema>

XML
<?xml version="1.0" encoding="utf-8"?>
<!-- VS 2008 generated schema -->
<xs:schema id="_Test"
    targetNamespace="http://tempuri.org/_Test.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/_Test.xsd"
    xmlns:mstns="http://tempuri.org/_Test.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
</xs:schema>
Posted
Updated 19-Jul-10 10:11am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900