English 中文(简体)
Does anyone know of a way to view all compiler warnings for a VB.NET project?
原标题:

VB.NET has this rather annoying limitation which caps compiler warnings reported at 100.

vbc : warning BC42206: Maximum number of warnings has been exceeded.

This makes things rather frustrating when trying to size up the amount of effort that would be required to comply with VB.NET best practices, such as enabling Option Strict.

Is there any way where this limitation could either be removed, adjusted, or could warnings be gathered by some other means (such as through a 3rd party code-analysis tool)?

最佳回答

As of VB11, in VS2012, vbc no longer has a maximum error limit when called from the command line.

There s probably a better link for this now, but this will do until I find one.

UPDATE: new link

问题回答

The official answer is apparently "No." From Microsoft: "While this issue does exist, the Visual Basic Compiler Team has decided to leave the hard limit to the reported errors because it helps with performance."

You should read Configuring Warnings in Visual Basic and How to: Enable or Disable Compiler Warnings

For example, you can to the compiler options (under the project build properties) the following line

warnaserror:42206

this should (I haven t tried it myself...) disable your 100 errors limit.

On another note, 100 warnings is a very large number. You should probably go over your code, check and fix the reasons to those warnings.

I ve had the same problem with SQL projects I ve been working on; the limit is 200 warnings. Then as I fix them, new ones merge in so the number never goes down!

I found that if you look in the "Build" output in the "Output" tab you can see everything. In my case I have thousands. Just select all and copy/paste it into a text editor.





相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签