How to make Visual Studio 2010 recognize file extensions as C#/ASPX/C/C++ files?
There was a solution for VS 2005 here:
http://www.dotnetmonster.com/Uwe/Forum.aspx/vs/3298/Make-Visual-C-recognize-file-ex开发者_如何学运维tensions-as-C-files
But doesn't find same registry for VS2008 and VS2010. So where can I find the solution update for this ? Thanks.
If what you're looking for is syntax highlighting for different extensions in the VS 2010 editor: Go to Tools -> Options -> TextEditor -> File Extensions and enter the extension.
I don't think it is any different. You however have to change the version number in the registry key name HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions. VS2008 is 9.0, VS2010 is 10.0
These kind of registry hacks don't scale very well. It stops working when you open the project on another machine or use a different VS version. As you found out. Just renaming the file is the much lower pain-point.
精彩评论