Exclude Files not working

Exclude Files not working

Hi I am trying to exclude some file from NCover report but I get an error message:

"C:\Program Files\NCover\NCover.Console.exe" "C:\Program Files\NUnit 2.5.6\bin\net-2.0\nunit-console.exe" "D:\LatestUnitTestBinaries\NightlyTrunk\Exchange connectors.nunit" //a

"FF.Eurex.12;FF.Eurex.13" //x "D:\LatestUnitTestBinaries\NightlyTrunk\Exchange connectors.nunit.Coverage.xml" //l "D:\LatestUnitTestBinaries\NightlyTrunk\Exchange connectors.nunit.log" //ea

"FFSerialization.GeneratedSerializatorAttribute;FFGeneratedTranslatorAttribute" //ef "C:\Program Files\Microsoft Visual Studio 10.0\vc\include\msclr\lock.h" //ll Normal

and it says:

Invalid regular expression in Excluded Source Files list: c:\program files\microsoft visual studio 10.0\vc\include\msclr\lock.h

Any idea what I am doing wrong ?


RE: Exclude Files not working

You must escape the . since . is a special character in Regex

FF.Eurex.12

Hope that helps.

Joe


RE: Exclude Files not working

Good call, Joe. Got to escape the " . ". Please let us know if you have any issues. support@ncover.com


RE: Exclude Files not working

Tks a lot for your indications! I escaped the "." ->same message appeared Then I realized I have to escape the "\" as well so I changed it like this: /ef "C:\Program Files\Microsoft Visual Studio 10.0\vc\include\msclr\lock.h"

and works perfectly.


RE: Exclude Files not working

Awesome! I'm glad you found that. Thanks for letting us know.


RE: Exclude Files not working

no prob :-) in my message did not appear explicitely -i escaped both the point and backslash characters and it worked.


RE: Exclude Files not working

I would like to ask you one more thing -I need to exclude from coverage xml all the files not located into the folder D:\NGBuilds. I thought about writing like: //if "d:\NGBuilds\." but maybe this would cause to have included into my report some unnecessary files Would be better rather to use exclusion -so to have excluded from my report all the files not located into D:\NGBilds? Problem is I do not know how to do this negation -maybe something like this: //ef "^((?!.D:\NGBuilds).)*$"


RE: Exclude Files not working

krc_pg, your original plan for using //if should work fine. You'll include into coverage only the file(s) that you specify. Everything else will be excluded. If you find that you have trouble with this setup, please let me know: support@ncover.com.