开发者

ASP.Net 4.0 App Builds Successfully But Has Errors (?)

开发者 https://www.devze.com 2023-01-18 01:37 出处:网络
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.

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 bu开发者_运维知识库ild 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


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.


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...


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消