0

I am now getting IntelliSense validation in Visual Studio when I edit CustomDictionary.xml by incorporating a reference to CustomDictionary.xsd as advised here. However, I am getting validation errors in Microsoft's default CustomDictionary.xml which I did not expect. For example, for this entry:

<Term PreferredAlternate="EnterpriseServices">complus</Term>

...I am seeing the error:

The element cannot contain text. Content model is empty.

(Note that I am seeing a blue squiggled line beneath the word complus.) This suggests that there is a problem with the CustomDictionary.xsd schema file. Note that I obtained my copy of the schema file from this location within my Visual Studio 2017 installation:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\
    Static Analysis Tools\Schemas\CustomDictionary.xsd

And that the default CustomDictionary.xml can be found here:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\
    Static Analysis Tools\FxCop\CustomDictionary.xml

Proposed remedy: To get proper validation for CustomDictionary.xml in Visual Studio, it seems that changes need to be made to CustomDictionary.xsd. Can anyone confirm this?


Additional comment: I find it notable that these files have not changed since it least Visual Studio 2013. Here are their locations:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\
    Static Analysis Tools\Schemas\CustomDictionary.xsd

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\
    Static Analysis Tools\FxCop\CustomDictionary.xml
DavidRR
  • 18,291
  • 25
  • 109
  • 191

1 Answers1

0

I researched my question and made changes to CustomDictionary.xsd that resolved the IntelliSense validation errors that I had been seeing. Here are those changes:

Before:

<xs:attribute name="PreferredAlternate" type="xs:string" use="required" />

<xs:attribute name="CompoundAlternate" type="xs:string" use="required" />

After:

<xs:simpleContent>
  <xs:extension base="xs:string">
    <xs:attribute name="PreferredAlternate" type="xs:string" use="required" />
  </xs:extension>
</xs:simpleContent>

<xs:simpleContent>
  <xs:extension base="xs:string">
    <xs:attribute name="CompoundAlternate" type="xs:string" use="required" />
  </xs:extension>
</xs:simpleContent>
DavidRR
  • 18,291
  • 25
  • 109
  • 191
  • 1
    Hi David, we are so glad to hear that your issue is solved, thanks for your sharing. Please mark your reply as answer when you have free time, that will help others to easier search this helpful information, thanks in advance. – Sara Liu - MSFT May 10 '19 at 08:53