Derik Whittaker

Syndication

News


Removing Generated code from NCover Reports

If you are a user of NCover you know it has great power and that it can generate great results.  But what do you do if you do not want to include certain items in your coverage report?  In particular what do you do if you have generated code (say WCF Proxy code) which you do not want to skew your coverage numbers?

Simple, you exclude them right :)

If you are simply using the NCover Explorer this is easy, you can right click the namespace/type and say exclude.  But what if you are using NCover from the command line?  Well this is also simple.

All you need to do is use the excludeAttributes option for NCover.

image

The code above is what we use to generate our NCover reports, the important part is how we are using excludeAttributes.  Now I know you are saying, wait you have a property being called, I want to see the ‘real’ value.  Well it is below

excludeAttributes=”System.CodeDom.Compiler.GeneratedCodeAttribute”

Adding the code above will tell NCover to exclude any code with the above attribute (which should be good for WCF Proxies).

Till next time,


Posted 02-11-2010 7:12 AM by Derik Whittaker

[Advertisement]

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)