NCover.Console requires administrative privileges

NCover.Console requires administrative privileges

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

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

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

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

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

David,

What version of Windows are you running on?

Alan Johnson NCover Team


RE: NCover.Console requires administrative privileges

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

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

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

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

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

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

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

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

nideeshm,

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

Stephen Ward


RE: Re: Coverage problem with TestDriven and NCover

as this thread suggests, just running NCover as a logged in Administrator doesnt work. I am attempting to get started with NCover on a multi-core X64 Windows-7 box. I downloaded the X64 version of NCover and followed the setup instructions and when I start NCover get the "administrator" error noted throughout this thread. Whilst making customers (maybe in a development shop) have to run an app under administrator privs doesnt sound a good idea, the fact that there is not concrete advice as to what to do next is a bit unfortunate. Can the steps to get over this be set out - Please... Thanks


RE: Re: Coverage problem with TestDriven and NCover

dharrison,

Thanks for your comments. We have such a list: http://docs.ncover.com/kb/ncover-3-with-admin-priviliges-in-windows-7/.