views:

32

answers:

3

I have an annoyance, not really a problem. In my ASP.Net 4.0 app, when I compile I get some errors of the type "Validation (CSS 2.1)". These fill up my Error List but yet the build still succeeds.

So two questions: 1. Why does my build succeed if it lists errors? If it truly is a successful build, why are these errors reported as Warnings of Messages?

  1. Where can I configure how my ASP.Net compiler chooses what and how to validate certain things? When I right-click on my ASP.Net project and go to Project Properties, I don't see any place where I can fine-tune my compiler's options for build errors etc.

Thanks Mark

A: 

They aren't errors, they are warning or even messages and it isn't the compiler generating them because CSS isn't compiled. You can ignore them by clicking on Messages or Warnings in the error list panel.

stimms
A: 

Neither warnings nor messages will prevent a build from happening - only errors.

Also, CSS errors/warnings/??? have no impact whatsoever on the compilation step - it's merely trying to validate the (x)html for you - and it doesn't always get it right anyway (under certain circumstances, validation fails in the UI but the actual html output is valid).

With regards to errors/warnings: You can configure what types of warnings are treated as errors - This will mean that warnings will prevent a successful build. If that's what you're after, it should be on the project properties compile tab. In the same screen you can also choose NOT to show certain categories of warnings/etc...

Basiclife
Thanks for the response. Maybe I didn't make my intentions a little clearer. I understand that CSS is validation (of course it's not compiled) but my question is why the validator is throwing these into my list of errors. I'm expecting that the compiler or any other validators are only going to throw things into my "Error List" that are things that would stop my build.
sisdog
Can you clarify what you mean by "My error list" - The Error List pane shows errors, warnings and messages from the compiler (and elsewhere) - So, are you getting *errors* (Red icon) or warnings?
Basiclife
A: 

New Wrinkle Found And Explained

Well, I have some new related info on this topic. For a week the problem/annoyance when away and I was baffled as to why. But then as quickly as the messsages went away they returned.

I figured out this new oddity. It seems that the VS2010 build process (F5/F6) only analyzes *.css files when they're open in the editor! When I run the build without any *.css files open the errors vanish.

Old Problem Still There

The error display problem is still happening. Hopefully you can duplicate it by creating a new *.css file with something like this in it (I happen to know that the css validator doesn't like the filter property).

.ext-el-mask { z-index: 100; position: absolute; top:0; left:0; -moz-opacity: 0.5; opacity: .50; filter: alpha(opacity=50); width: 100%; height: 100%; zoom: 1; }

When you hit F5 you'll get an error in your ErrorList view. This shouldn't be an "ERROR"!!

(Sorry, can't post picture, no reputation yet).

sisdog
Ok I found the answer at http://brian.chipsofttech.com/blogs/brian/post/VS-and-CSS-Errors-e28093-mark-as-Warnings.aspx. The CSS editor settings can move the errors to the warning tab. Bizarre behavior but problem solved!
sisdog