Hello Ronnie,
According to your description, you have a concern on that VS IDE compiler
is not detecting an unused parameter in the function parameter list,
correct? If I misunderstood anything here, please don't hesitate to correct
me.
I'm afraid to say VS IDE compiler doesn't check the parameter in the
function parameter list, even though you set the warning level to 4. But
the rule CA1801 defined in Code Analysis addressed this issue. If you'd
like to get such unused parameter error, you can enable the Code Analysis
as the following steps.
#1 Right-click on your C-Sharp Project, and click on the "Property" in the
context menu.
#2 Navigate to the "Code Analysis" page
#3 Check the "Enable Code Analysis (defines CODE_ANALYSIS Constant)"
checkbox.
After that, if you build your project again, VS IDE will throw a Warning
message like below
"CA1801 : Microsoft.Usage : Parameter 'a' of Class1.test(Int32):Object is
never used. Remove the parameter or use it in the method body."
By the way, you can also clear all the checkboxs in the "Rules" panel, and
then only check the rule "CA1801".
Hope this helps. If you have any more concern, please feel free to update
here again. We are glad to assist you.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Ronnie Smith - 05 Jan 2008 00:52 GMT
Hello Wen,
Thanks for the info. After some research on your post I discovered
that Code Analysis is not available for VS 2005 Professional - just
the Team Edition.
It seems that FX-cop provides this functionality though - but I'm not
sure how.
Thanks for pointing me in the right direction.
Ronnie
> Hello Ronnie,
>
[quoted text clipped - 33 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
WenYuan Wang [MSFT] - 07 Jan 2008 08:30 GMT
Hello Ronnie,
Thanks for your reply.
As you may seen, VS 2005 provides IDE with FxCop. But this great feature is
only available for VS 2005 Team Edition.
For Professional Edition, we can still use FxCop. But, we lose the feature
supported by IDE. You may get FxCop at http://www.gotdotnet.com/team/fxcop/
Below is a document describes how to Analyze the managed .NET code with
FxCop
therhttp://www.gotdotnet.com/team/fxcop/gotdotnetstyle.aspx?url=FxCop.html
[Quick Start Guide to FxCop]
Hope this helps, let me know if there is anything unclear. It's my pleasure
to assist you.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Ronnie Smith - 07 Jan 2008 16:40 GMT
Thank you Wen for your assistance.
FxCop was what I needed.
Thanks again,
Ronnie
> Hello Ronnie,
> Thanks for your reply.
[quoted text clipped - 19 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
WenYuan Wang [MSFT] - 08 Jan 2008 06:33 GMT
You are welcome, Ronnie.
I am glad to be of assistance. :)
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.