Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 - Warnings only shown for active file

i hope you can help me with my problem in Visual Studio 2010.

Normally in Visual Studio 2008, when i compile a project warnings for all files are shown. But not so in Visual Studio 2010. When i compile a project warnings are shown not until a file is active and then only warnings for the active file are shown in error list.

And I have recently found out something new: the problem only seems to be in ASP.NET Pages (.master, .aspx), but not in Behind-Code-Files (.master.cs, .aspx.cs). Is there a problem with warnings in relation with ASP.NET Pages (except the behind-code-files)?

Thanks in advance.

Best Regards, HeManNew

like image 992
HeManNew Avatar asked Sep 30 '11 13:09

HeManNew


People also ask

How do I turn on all warnings in Visual Studio?

If you want to turn it on (or off) in the project setting, you have to go to: Configuration Properties -> C/C++ -> Command Line and then under Additional Options you can enter: /w3#### to set your warning to level 3, and thus enable it; or you can enter /wd#### to disable a warning.

How do I get rid of warning treatment as error in Visual Studio?

Turn off the warning for a project in Visual StudioSelect the Configuration Properties > C/C++ > Advanced property page. Edit the Disable Specific Warnings property to add 4996 . Choose OK to apply your changes.

How do I show error codes in Visual Studio?

You can click on the summary or press Ctrl+Shift+M to display the PROBLEMS panel with a list of all current errors. If you open a file that has errors or warnings, they will be rendered inline with the text and in the overview ruler.


2 Answers

Visual Studio 2008 and 2010 actually behave the same when listing errors and warnings for pages.

A page's errors and warnings appear in the Error List when its editor is open (regardless of whether it's the active window) or when the errors (not warnings or messages) prevent the application from compiling. But because markup pages are not compiled, only server-side errors prevent the application from compiling.

So, in sum, Visual Studio is behaving correctly. To see the errors and warnings particular to a markup page, you need to open it first. Compiling has nothing to do with markup errors.

like image 91
Devin Burke Avatar answered Nov 15 '22 05:11

Devin Burke


I know described behavior since VS2005 (I have no experience with earlier versions).

The .aspx is compiled at runtime (or when it is opened in VS 2010). So errors (and warnings) are found when page is run. You can even edit .aspx and new version is used when page is reloaded (the load time is considerably longer).

I don't know any way to say to iis to compile all aspx.

But maybe we experience a different behavior because I see warnings for all opened .aspx files, not only for the active one.

like image 22
IvanH Avatar answered Nov 15 '22 05:11

IvanH