'myCssProp' is not a known CSS property name

Posted by Marcus Hammarberg on October 25, 2006
Stats

My good friend Fredrik "Fran" Anfelter found the solution of a very irretating problem.

If Visual Studio 2005 is set to Treat all warnings as error, with warning level 4 (which both are good practices) you will get a LOT of error for any CSS-properties that is defined by you. This has to do with that no XML-schema exists to validate those properties for the .css-file.

However there is a setting in Visual Studio 2005 that will help you to get rid of those errors. Under Tools->Options->Text Editor->CSS->CSS Specific the dialog to the right can be found.

Simply uncheck the "Detect unknown properties" and the errors a but a memory from the past.

The "formally correct" solution would have been to include a XML-schema that validates the properties used in the css-file. Two problems though:

  • How do you point the xml-schema to the css-stylesheet?
  • Who has the time to keep that schema up to date just to get rid of the errors?


Published by Marcus Hammarberg on Last updated