FxCop and CSLA

FxCop and CSLA

Old forum URL: forums.lhotka.net/forums/t/5191.aspx


sixeyes posted on Monday, August 04, 2008

I'm sure quite a few people here use FxCop.

I was wondering which rules people were disabling and / or suppressing with attributes to remove messages specifically related to the use of CSLA.

Iain

sixeyes replied on Friday, August 22, 2008

I don't know if the lack of replies means no one here's using FxCop but I'll pass on one thing a colleague discovered to improve FxCop and CSLA since my initial post.

I was declaring DataPortal_xxx to be private. This often caused the code to be marked as unused. I was suppressing this message but it meant any properties etc only accessed by DataPortal_xxx we also marked unused.

A colleague discovered that by declaring the DataPortal_xxx to be protected the code is considered used and instead we could suppress the message warning that the method name contained an underscore.

Iain

vdhant replied on Friday, August 22, 2008

I think there are also attributes that you can add which suppress the messages. I know that this isn't all that nice but it should do the job.

I'm not sure if these are specfic to FxCop or not but this is what CSLA itself does: [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", MessageId = "Member")]

Hope that helps.

Copyright (c) Marimer LLC