Can I tell Visual Studio how treat a file with a custom file extension?

Viewed 13487

Can I tell Visual Studio how treat a file with a custom file extension? I want to be able to open a file with ".xxx" extension in Visual Studio and have CSS highlighting.

I've tried to do it by going to VS -> Tools -> Options -> Text Editor -> File Extension but in the Editor drop down there is nothing to specify "treat it as CSS".

3 Answers

Tested on Visual Studio 2019. Tools > Options > Text Editor > File Extension add your file extension with '.' like .ejs (Node.JS View Engine) and then set it to one of known editors and press add: .ejs >> HTML Editor Close and reopen the files with .ejs in VS & you will see HTML markups on them.

Related