Click here to Skip to main content
15,666,844 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

While i am running Mymath , a c# application using NCover as shown below:

C:\Program Files\NCover>ncover.console D:\Mymath\Mymath\bin\Debug\Mymath.exe

I got below output:
NCover is unable to write a file to 'C:\Program Files\NCover\coverage.nccov'
because it it running without administrative permissions.

Please let me know solution for this.
Updated 10-Oct-11 19:02pm

before opening your command prompt do the following things
1. Start --> All Programs --> Accessories --> right click command prompt click on Run as.. and select administrator
and then run your command
Share this answer
skumarn 11-Oct-11 1:49am    

Thank you very much. I have resolved that iwth your solution. Please let me know how to use this NCover in build script with NUnit and
koolprasad2003 11-Oct-11 1:54am    
check the following link
Use the following command line :
C:\>ncover.console.exe //x "c:\coverage.nccov" D:\Mymath\Mymath\bin\Debug\Mymath.exe
Share this answer
skumarn 11-Oct-11 1:39am    
Hi Mehdi,
I got below for your solution
The executable can not be located at: 'coverageFile=c:\coverage.nccov'
Mehdi Gholam 11-Oct-11 1:51am    
Sorry, it was the cruisecontrol definition, I've updated the answer.
skumarn 11-Oct-11 1:56am    
Hi Mehdi,
I got solution by opening command prompt with Run As administartor as given by koolprasad. Please tell me how to use this NCover in my build script with NUnit using
Mehdi Gholam 11-Oct-11 2:10am
skumarn 11-Oct-11 3:29am    
Hi Mehdi,

when i run NCover from command prompt i got below output
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.



C:\>cd Program Files

C:\Program Files>cd NCover

C:\Program Files\NCover>ncover.console D:\Mymath\Mymath\bin\Debug\Mymath.exe
NCover Complete Trial v3.4.18.6937 x86 (Administrator)
Copyright (c) 2007 - 2010 Gnoso Inc.
Registered to Customer #: 65856 for 1 Machine
20 days left in the trial period.

Command: "D:\Mymath\Mymath\bin\Debug\Mymath.exe"
Command Args:
Working Directory:
Assemblies: (All Loaded Assemblies)

******************* Program Output *******************
Process 'Mymath' [PID 4052] has begun profiling.
Process 'Mymath' [PID 4052] has finished profiling.

***************** End Program Output *****************

Execution Time: 74.8423 s
Symbol Coverage: 35.45%
Branch Coverage: 23.44%

Coverage File: C:\Program Files\NCover\coverage.nccov

Please tell me how can i got the code coverage percentage as above with NCover
using I had fallowed the link as mentioned by you but i did not got percentage output.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900