TIP: Associate a schema with an XML file in Visual Studio 2010

It’s been a while since I had to do it.  However, as I’ve started to need to tweak FetchXML after I’ve built the baseline using my little trick, I realized I was doing things the hard way.  I was looking at the FetchXML reference on MSDN and typing things “notepad" style” but with syntax highlighting.  Then I had that “DUH” moment.  Just point the file to the FetchXML schema in the SDK and you’ll get intellisense.  Here’s how:

Take a look at the Properties of your XML file in Visual Studio:

image

In the Properties pane, click on the ellipsis () for the Schemas property:

image

Click the Add… button:

image

Find the fetch.xsd file that’s in the schemas folder of wherever you unzipped the Microsoft Dynamics CRM 2011 Software Development Kit (SDK) and click the Open button:

image

Now you have XML intellisense for your FetchXML:

image

@devkeydet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s