I have read the MSDN Page on how to suppress messages. I am unable to supress warnings for VS2008.
I have tried the following instructions listed:
In the Error List, select the warning or warnings to suppress. Multiple warnings can be selected at the same time.
Right-click the warning, point to Suppress Message(s), and click either In Source or In Project Suppression File.
The specific warning is suppressed, and the warning appears in the Error List window with a strikethrough.
However, when I right click in the 'Error List' I only get the following options:
- Sort By
- Show Columns
- Show Error Help
- Copy
- Previous Error
- Next Error
Why does Visual Studios 2008 for VB.net not display 'Suppress Messages'?
I cannot generate the following suppressing messages:
<Scope:SuppressMessage("Rule Category", "Rule Id", "Justification", "MessageId", Scope = "Scope", Target = "Target")>
The problem was I had a series of parallel tasks that were dependent on check boxes. I wanted each task to to run simultaneously and then join back. I overcame the warning by using a callback method that decremented until all the call backs completed.
ie (from memory):
chkbox1.enable = false
chkbox2.enable = false
dim dlgChkbox1 as Action = addressof Task1
dim dlgChkbox2 as Action = addressof Task2
...
if chkbox1.checked = true then
result = dlgChkbox1.BeginInvoke(nothing,nothing)
end if
if chkbox2.checked = true then
result = dlgChkbox2.BeginInvoke(nothing,nothing)
end if
...
if chkbox1.checked = true then
dlgChkbox1.EndInvoke()
end if
if chkbox1.checked = true then
dlgChkbox2.EndInvoke()
end if
...
chkBox1.enable = true
chkBox2.enable = true
The warning was an Uninitialized Variable. Which was not the case as it was dependent on identical if-statements. I opted to use a callback method instead, which turned out to be a better alternative and did not lock up the GUI.