How to make Visual Studio stop "compiling" .js and .css files
Solution 1:
Enter the options through
Tools > Options
If it isn't checked, check the "Show all settings" box at the bottom of that window.
In the tree to the left, choose:
Text Editor > CSS > CSS Specific
Uncheck "Detect Errors". Then, choose:
Text Editor > JScript > Miscellaneous
Uncheck "Show syntax errors".
You can also change how it indents each type of code too, in the various settings in those "Text Editor" sub-options.
Solution 2:
I know, this question is old, but I have an update (for Visual Studio 2010):
The accepted solution has a big disadvantage: It disables all syntax checking of CSS and JScript. If you still want to have meaningful warnings, you can do the following workaround. It will treat errors as warnings, and it will do css validation on css V3.0 level rather than on (old) css V2.1:
- Close Visual Studio
- Download and install the web standards package for Visual Studio 2010 SP 1
- Open the path (on 32 bit machines, it is
Program Files
)C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\1033\schemas\CSS
- Backup
CSS21.xml
for safety reasons - Overwrite
CSS21.xml
by the fileCSS30.xml
(in the same directory) - Open Visual Studio. In Text Editor settings, (re-)enable "Show syntax errors". Ensure you have checked "as warnings" too.
(Note that the Style Sheet toolbar only allows to enable CSS 3.0 checking for css files, not for HTML. Hence, this fix is needed if you want to keep syntax checking)