2

Where to define, what kind of type a particular file within Visual Studio solution is?

I have observed that file extensions do not necessarily have to relate to the actual file types within VS.(observed within Visual Studio 2010, 2012).

For example: I have an existing Visual Studio solution. In another tool, I have created an HTML file with .html extension. After importing it into Visual Studio solution, the file does not gain HTML Intellisense and Code Completion.

On the other hand, I can create an HTML file within Visual Studio through: Visual Studio -> FILE -> New File -> HTML Page

This file will gain all its HTML related Code Highlight, Intellisense, and Code Completion features. I can then rename its extension to, say, .txt. The file will still keep its HTML properties such as code highlight, intellisense, etc..

My question therefore is, where can I define/change, what kind of file type (HTML, CSS, JavaScript) the particular file is, regardless of its extension? This is important, to be able to assign appropriate Intellisense, Code Highlight, Code Completion features.

Bunkai.Satori
  • 4,698
  • 13
  • 49
  • 77
  • It depends on the IDE you are using. If it is C++ then the File Type property matters. – Hans Passant Aug 26 '12 at 19:14
  • @HansPassant, hi. Well, I use only Visual Studio 2012. And it does not matter which editor the imported file has been created in. – Bunkai.Satori Aug 26 '12 at 19:23
  • How did you do "After importing it into Visual Studio solution" this? right click project --> add --> existing item --> browse to file? Also, exactly the opposite thing should happen if you change the file extension. That is the default VS behavior. – Andrew Clear Aug 26 '12 at 21:16
  • @aclear16, hi and thanks for the response. Basically, I had a web project in advanced phase, and I wish to try Visual Studio to continue development. To import the project I simply went to: **VS->FILE->Open Web Site**. After doing that, all my website files and folders appeared in the Solution Explorer. Then I continued working on them, and noticed the above mentioned issues. – Bunkai.Satori Aug 26 '12 at 21:31
  • 1
    Try file --> new --> project from existing code instead. I believe you need a VS solution & project in order to get intellisense. – Andrew Clear Aug 26 '12 at 21:43
  • @aclear16, +1, hello. i will try it, when I get home. Right now I am at the work. Thank you for your comment and help. – Bunkai.Satori Aug 27 '12 at 11:33

0 Answers0