Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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-extensions-as-C-files

But doesn't find same registry for VS2008 and VS2010. So where can I find the solution update for this ? Thanks.

like image 767
user310291 Avatar asked Dec 29 '10 04:12

user310291


2 Answers

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.

like image 145
Jeremy Seekamp Avatar answered Oct 22 '22 08:10

Jeremy Seekamp


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.

like image 41
Hans Passant Avatar answered Oct 22 '22 09:10

Hans Passant