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

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.
Posted
Updated 10-Oct-11 19:02pm
v2

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
 
Comments
skumarn 11-Oct-11 1:49am    
Hi,

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 cruiseControl.net
koolprasad2003 11-Oct-11 1:54am    
check the following link

http://docs.ncover.com/how-to/continuous-integration/cruisecontrol-net/
Use the following command line :
C:\>ncover.console.exe //x "c:\coverage.nccov" D:\Mymath\Mymath\bin\Debug\Mymath.exe
 
Share this answer
 
v2
Comments
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.

http://docs.ncover.com/ref/3-0/ncover-console/command-line/output#x
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 CruiseControl.net
Mehdi Gholam 11-Oct-11 2:10am    
http://docs.ncover.com/how-to/continuous-integration/cruisecontrol-net/
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:\Windows\system32>cd..

C:\Windows>cd..

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.
License Key: QYSX1DBZRB6VPYAA
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 CruiseControl.net. 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