More than one FxCop tip

by Matt 8. April 2007 18:02

FxCop is pretty useful. No, really. Automated code review type thing. Sort of. And here I am about to give you the best FxCop tip in the world. Well, actually the best two FxCop tips. Ok, make it three. Ah stuff it, here's a whole bunch of them.

First top tip - unless you're using the version of FxCop that's integrated into Visual Studio (I'm not), you'll want to define the CODE_ANALYSIS symbol in your project settings. This is because the SuppressMessageAttribute class is decorated with a ConditionalAttribute with the CODE_ANALYSIS symbol. In other words, the SuppressMessage attribute will be ignored unless you define CODE_ANALYSIS. (Only define it for debug projects. Consider that a bonus tip.)

(Of course, you might actually want it to be ignored to stop over-zealous/lazy programmers suppressing FxCop violations instead of fixing them. But hey, let's try and stay glass half full, eh?)

Here's one I prepared earlier - ensure your spell check language is consistent across all users. And the top up tip is to ensure that you're all on the same version (and service pack revision) of Office.

The FxCop team blog provides a way to run FxCop as part of a normal build, including a bug and workaround. But this doesn't use a project you might have set up, so you might want to give the FxCop msbuild task from the MSBuild Community Tasks Project, or just play about with the /project command line option. (This blog post has more details on FxCop/Visual Studio integration, including a link to an FxCop addin, that I'll have to have a look at.)

Speaking of projects, FxCop bizarrely saves the messages to the project file after each run. The advantage of this is that you get to see what's changed between runs, with new messages displayed in bold, but you do need to have the file checked out each time you run an analysis. If you don't want this, uncheck the option to save Active messages in the project. You still want to keep exclusions checked though - that's a change that you do want saved. Alternatively, you can save active and excluded messages to the report file and use the /import switch to FxCopCmd to get it to read those files. This way, your project file doesn't have to change at all, but managing the reports in source control could get tricky. (I feel a post analysis script coming on...)

I think that last paragraph can be summed up simpler - read the docs. Or at least, read the "Managing FxCop Projects" page. It's dead easy to get started with FxCop, but once you start to get a bit more advanced, it's not terribly obvious what's going on. And if you're putting FxCop into a build process, you'll really want to read through "Using FxCopCmd".

But the number one best FxCop tip? Simple. Run it from day one. Don't let the violations back up, or you'll never bother to clear them down.

Tags:

.net tools | FxCop

Comments (32) -

best suv 2010
best suv 2010
7/20/2011 10:20:08 PM #

Fantastic task I like your type! Would really like to right here your feedback on my website! I am also seeking for someone to help you me make websites!

Reply

luxury car
luxury car
7/22/2011 1:34:01 AM #

Una pagina sarà dedicata agli accessori, una alle giacche e ai giubbotti. Troverai le indicazioni per lo spaccio o negozio Moncler più vicino a casa tua e tutte le offerte più vantaggiose di questo prestigioso marchio.

Reply

best ipad games
best ipad games
7/24/2011 3:50:59 AM #

Per il tuo bambino scegli Moncler. Una scelta di capi, estivi ed invernali, eccezionali. Tuo figlio sarà sempre alla moda e potrà muoversi in totale comodità.

Reply

domain name coupon
domain name coupon
8/24/2011 3:26:38 AM #

Thanks for writing about something so well written. I bookmarked it on mixx - need more sites like this!

Reply

Eric
Eric
10/22/2011 10:02:46 AM #

hello there,

Interresting post here

Reply

Lisa
Lisa
10/23/2011 11:59:38 AM #

Hello

nice post here
continue updating your blog

Reply

Stephane
Stephane
10/23/2011 7:26:26 PM #

Hi

Interresting post here

Reply

Eric
Eric
10/23/2011 8:46:47 PM #

hello there,

Interresting post here may come back soon
continue updating your blog

Reply

Robert
Robert
10/23/2011 10:50:58 PM #

Hi

Interresting post here will came back
keep update

Reply

Stephane
Stephane
10/24/2011 12:25:24 AM #

Hi

Interresting post here may come back soon
Keep like this

Reply

Robert
Robert
10/24/2011 12:27:15 AM #

Hello

Interresting post here will came back
keep update

Reply

proto
proto United States
10/27/2011 4:14:28 AM #

hi, this is my comment

Reply

proto
proto United States
10/27/2011 4:26:52 AM #

hi, this is my comment

Reply

proto
proto United States
10/27/2011 4:31:12 AM #

hi, this is my comment

Reply

iPad games reviews
iPad games reviews
12/1/2011 5:02:42 AM #

Good job  , amazing Post !!!

Reply

photographe mariage paris
photographe mariage paris United States
6/8/2015 1:59:48 AM #

I have seen that today, more and more people are being attracted to cameras and the issue of images. However, like a photographer, it's important to first commit so much of your time deciding the exact model of dslr camera to buy as well as moving out of store to store just so you might buy the least expensive camera of the trademark you have decided to settle on. But it won't end generally there. You also have to take into consideration whether you should purchase a digital video camera extended warranty. Many thanks for the good suggestions I obtained from your web site.

Reply

Philix
Philix United States
11/22/2015 10:12:22 AM #

Superb Website.

Reply

Leonel Marturano
Leonel Marturano United States
1/15/2016 4:57:06 AM #

The dolphin saving you one is the best one!

Reply

Isreal Payor
Isreal Payor United States
1/15/2016 8:32:32 AM #

getting the last pair of shoes in your size AWESOME!

Reply

Andrew A. Sailer
Andrew A. Sailer United States
10/18/2016 2:44:15 AM #

Un petit message pour vous dire que votre site est vraiment excellent ! je suis vos infos r�guli�rement et j'esp�re qu'elles continueront! A bient�t !

Reply

lesbian dildo review
lesbian dildo review United States
9/12/2018 5:27:53 PM #

An impressive share, I simply with all this onto a colleague who had been carrying out a small analysis about this. Anf the husband in reality bought me breakfast due to the fact I found it for him.. smile. So allow me to reword that: Thnx with the treat! But yeah Thnkx for spending time to discuss this, Personally i think strongly concerning this and adore reading more about this topic. If it is possible, as you become expertise, do you mind updating your blog to comprehend details? It is highly a good choice for me. Huge thumb up in this text!

Reply

cash-for-old-car.com.au
cash-for-old-car.com.au United States
9/17/2018 1:03:31 AM #

I dugg some of you post as I  cogitated  they were  invaluable   very helpful

Reply

虎背熊腰
虎背熊腰 United States
10/7/2018 9:46:32 PM #

拉皮原理、拉皮種類、前額拉皮、抬眉手術、傳統前額拉皮、內視鏡前額拉皮、直接抬前額拉皮、改良式髮際線拉皮、五爪拉皮術等一些相關議題、似是而非或有爭議的事項的披露與討論。

Reply

HIFU 無創超聲波4D拉皮
HIFU 無創超聲波4D拉皮 United States
10/7/2018 11:16:08 PM #

我們彩用國際及美國食品及藥物管理局FDA認可的CO2 激光儀 Lutronics® Spectra SPR, 具安全性, 準確度高 . 二氧化碳激光可安全地去除皮膚上的癦痣、肉粒、疣、老人斑等問題。此激光的幼細光束可準確及直接地將要去除的組織氧化,過程快捷,傷口細小及乾淨,對周圍的皮膚傷害減至最少。一般1-2次就可永久去除。

Reply

數碼營銷綜合方案
數碼營銷綜合方案 United States
10/9/2018 9:26:46 AM #

POS訂單系統整合

Reply

今年那麼流行的土色怎麼我塗了真的變土人了?原來要讓膚色決定唇色 不要再盲跟潮流了啦    Marie Claire (HK) Edition  今年超級流行的乾燥玫瑰唇膏色調或土色調迷倒不少女生,每個人都吵著要被家中的收藏添加一枝這樣的唇膏。好了,就連小編都被接二連三的攻勢而把持不住,終於決定把土色/乾燥玫瑰色的唇膏及唇釉收納到旗下,滿心歡喜    

Reply

醫學美容 瘦腿 cosmetic.wiki
醫學美容 瘦腿 cosmetic.wiki United States
10/16/2018 8:40:51 PM #

[美妝]黑白雙C打造韓妞光透亮裸肌 banila co. 光透CC霜 & 無瑕光透CC霜 @ 潮流、美妝、消費 創造個人化風格的女性社群 PIXstyleMe  [美妝]黑白雙C打造韓妞光透亮裸肌 banila co. 光透CC霜 & 無瑕光透CC霜      

Reply

acer Spin 5 輕鬆翻轉再翻轉 聲音也能操控筆電? @ 潮流、美妝、消費 創造個人化風格的女性社群 PIXstyleMe  acer Spin 5 輕鬆翻轉再翻轉 聲音也能操控筆電?      

Reply

I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while.

Reply

Prince Fransen
Prince Fransen United States
11/7/2018 1:09:46 AM #

Terrific work! This is the type of information that should be shared around the net. Shame on the search engines for not positioning this post higher! Come on over and visit my website . Thanks =)

Reply

Lettie Orner
Lettie Orner United States
11/10/2018 7:33:08 PM #

I used to be very pleased to seek out this internet-site.I wished to thanks on your time for this excellent learn!! I undoubtedly having fun with each little bit of it and I've you bookmarked to take a look at new stuff you weblog post.

Reply

Monty Stolinski
Monty Stolinski United States
11/11/2018 11:17:53 PM #

Howdy very cool site!! Guy .. Beautiful .. Amazing .. I will bookmark your blog and take the feeds also…I am happy to find so many helpful info here in the publish, we want work out more strategies in this regard, thanks for sharing. . . . . .

Reply

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS