Welcome, Guest!

NCover.Console requires administrative privileges

NCover.Console requires administrative privileges

by keith on Saturday January 19, 2008, 02:19 PM

I downloaded your product today in hopes of using it in a CruiseControl.NET setup on a server. And I just ran into this problem:

[ncover] -- Top-level exception
[ncover] Profiled process terminated. Profiler connection not established.
[ncover] Make sure NCover is running with administrative privileges.

Why is it your program requires admin privs? Your profiler isn't trying to profile a system process - it's profiling a process that it launched. I don't see why this requires high privilege.

Can you please elaborate? Perhaps we can figure out a workaround.

RE: NCover.Console requires administrative privileges

by sporewell on Monday January 21, 2008, 06:33 AM

Keith,

NCover requires admin privileges not for the profiling itself but for communicating between the profiler and console segments of NCover, so that the profiling data can be extracted from shared memory and presented to the user. Unfortunatly, the communication between the profiler and console portions makes use of kernel objects for locking and synchronization because there isn't much else available. We've discussed implementations that would require fewer privileges, but each one would require reworking how the profiler stores coverage data as well as how the profiler and the console sections communicate, and so far we haven't had a good enough reason to justify the (massive) time expenditure.

Regards,
Stephen Ward

RE: NCover.Console requires administrative privile

by keith on Monday January 21, 2008, 09:55 AM

Is the profile spawned by the console? If so, they run under the same user account, which means if one creates a kernel object, the other should have full permission to it automatically. Are you guys checking if the user is an admin and failing otherwise? I hope not; perhaps it's possible that some configurations would work just fine without any tweaking at all.

I have a lot of experience in this area, so please let me know if I can help. It's important to be able to run services with low privilege on servers, including CruiseControl...

RE: NCover.Console requires administrative privile

by peterw on Monday January 21, 2008, 10:37 AM

Keith,

We'd be happy to talk with you more about this issue. Yes, the profiled process is launched by NCover.Console; however, the profiled process (IIS, Windows Service) is often run in an alternate session (especially on Windows Vista). NCover uses shared memory to communicate coverage data between NCover.Console and the profiled application. Unfortunately on Windows Vista, you cannot call CreateFileMapping on a Global handle without SeCreateGlobalPrivilege. That privilege is typically only granted to Administrative users.

I'd be happy to discuss this further offline, peterw@gnoso.com.

Thanks,
Peter Waldschmidt

RE: NCover.Console requires administrative privileges

by lxwei60 on Thursday February 07, 2008, 02:36 PM

I downloaded NConver today, and got this same error. but I AM an administrator, do i need to do anything else to gain administrative previliges?

David

RE: NCover.Console requires administrative privile

by alan on Friday February 08, 2008, 01:24 PM

David,

What version of Windows are you running on?

Alan Johnson
NCover Team

RE: NCover.Console requires administrative privileges

by schmurgon on Saturday March 01, 2008, 02:20 AM

I've got the same problem attempting to profile an ASP.NET application on IIS7 (Vista SP1) running without UAC and with an Administrative account.

RE: NCover.Console requires administrative privile

by alan on Saturday March 01, 2008, 07:39 AM

schmurgeon,

Are you accessing ASP.NET pages after you initialize NCover? The profiler is unable to connect to IIS until a page is accessed, so a timeout will occur if no pages are accessed within the first minute or so of running NCover.

Alan
NCover Team

RE: NCover.Console requires administrative privileges

by schmurgon on Sunday March 02, 2008, 03:10 PM

Yes. We've got a suite of NUnit tests that execute requests for WCF services hosted in IIS. It's when I attempt to execute a test method that I get the crash.

RE: NCover.Console requires administrative privileges

by schmurgon on Sunday March 02, 2008, 03:14 PM

I should probably make it clear that I am testing WCF web services hosted in IIS and not a regular ASP.NET website. Should there be any reason why NCover won't work with WCF?

I've switched to an XP machine, and NCover appears to be ok. However, I get a ThreadAbortingException in my application when I attempt to run the tests. I've been able to use other profiling tools that use the profiling API (i.e. AQTime) on the services with no issues.

RE: NCover.Console requires administrative privileges

by sporewell on Tuesday March 04, 2008, 07:48 AM

NCover should profile WCF services hosted in IIS as easily as it profiles an ASP .NET service. Could you email a verbose log file, any xml output, and a screenshot of the exception to support at gnoso dot com and refer to this discussion?

Thank you,
Stephen Ward

RE: NCover.Console requires administrative privileges

by ggreig on Monday May 05, 2008, 05:13 AM

Just wanted to note that we won't be upgrading from NCover 2.0.3 until further notice, as we need NCover to run with normal user privileges (we're also using CruiseControl).

I hope that the collaboration Keith has offered you yields fruit, and look forward to hearing more.

RE: NCover.Console requires administrative privile

by dan.poxton on Thursday May 08, 2008, 07:01 AM

I've been putting together a continuous integration system for my company and have been trialling NCover.

For the most part its great and does exactly the job we need, but having our build server have to run with admin privileges is distinctly sucky. Our sysadmins (and my boss) don't like it either, so we'll be looking around for other alternatives. A shame :(

I hope this issue gets bumped up your priority list.

Dan

RE: NCover.Console requires administrative privileges

by nideeshm on Tuesday June 17, 2008, 03:54 AM

I am also getting the same error. If anyone has solved this please forward the solution to nideesh_manan@infosys.com. I am using administrator ID.

Log :
(0x000010E8) MESSAGE: Profiler Starting
(0x000010E8) **ERROR(0x00000000)** Access denied while connecting to profiler. NCover must run as Administrator on Windows Vista.
(0x000010E8) EVENT: Profiler Shutdown

console output :
***************** Exception *****************

-- Top-level exception (System.Exception)
No data was collected.
-- Stack Trace at NCover.Framework.ProfilerDriver._GetCoverageData() at NCover.Framework.ProfilerDriver.Execute() at NCover.ConsoleMain.ConsoleMain.Main(String[] args)

RE: NCover.Console requires administrative privileges

by sporewell on Tuesday June 17, 2008, 05:56 AM

nideeshm,

This problem can be easily resolved by running NCover as an administrator.

Stephen Ward