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:
In the Properties pane, click on the ellipsis (…) for the Schemas property:
Click the Add… button:
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:
Now you have XML intellisense for your FetchXML: