Geeks With Blogs
Andy Johns' Blog Andy's twisted brain....

I've been writing nant build files today. These files use an extension of “.build” and they contain XML data.... I'd like to use my normal XML editor, VS.NET IDE to manipulate these files, but the IDE does not recognize a “.build” file as an XML file....

Here's a simple way to tell the IDE that a “.build” or any other file extension you choose is an XML type file....

Open the registry (regedit) and navigate to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Editors\{C76D83F8-A489-11D0-8195-00A0C91BBEE3}\Extensions

If you look at the Default tag on {C76D83F8-A489-11D0-8195-00A0C91BBEE3} you will see this is the Html Editor settings. Looking at the other extensions in the Extensions list you'll see all the common markup langauges, html, xml, xsl, xslt, etc.

Just add a new  DWORD value under Extensions (with Extensions selected in the left pane, right-click in the right pane and choose New>DWORD Value.

Enter the extension you want as the name of the new value, double-click and set the Value Data to hex 28 (decimal 40).

The next time you start your VS.NET IDE it will recognize files of the new extension and markup, color, and whatnot appropriately....

-Andy

Posted on Friday, May 21, 2004 7:51 AM | Back to top


Comments on this post: nice hack - making VS.NET IDE see other files as XML type

# re: nice hack - making VS.NET IDE see other files as XML type
Requesting Gravatar...
There's an easier way! when you open the .build file from within VS.NET, there's a drop down on the right side of the "Open" button. Click that, and select "Open With..."

From here, select "HTML/XML Editor" and click "Set as Default" - now any time VS.NET opens a .build file, it uses the XML editor for it.

Both do the same thing, but registry editing is scary ;-)
Left by Joel Ross on May 21, 2004 8:50 AM

# re: nice hack - making VS.NET IDE see other files as XML type
Requesting Gravatar...
Nice tip, since I always either double-click or drag-drop files into the VS IDE I never even saw the Open dialog has those options.

Makes sense they'd offer a GUI method to associate new file extensions....

Thanks!
-A
Left by Andy Johns on May 21, 2004 8:57 AM

Your comment:
 (will show your gravatar)


Copyright © Andy Johns | Powered by: GeeksWithBlogs.net