Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3937878
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:07:11+00:00 2026-05-20T00:07:11+00:00

I want to run coverage from the command line, but can’t seem to get

  • 0

I want to run coverage from the command line, but can’t seem to get NCover 1.5.8 to instrument the code. It must be possible as when I run coverage tests with TestDriven.net it works. the difference seems to be that TD.NET is able to get NCover to use framework 4.0 (you get this in the log when it runs : MESSAGE: v4.0.30319) but from the command line I can’t make it (I get this in the log : MESSAGE: v2.0.50727)

So how can I make NCover play nice with nunit from the commandline, like it does with TD.NET?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:07:11+00:00Added an answer on May 20, 2026 at 12:07 am

    after more searching I found this:

    If you have found this thread because
    you are trying to get NCover 1.5.8 to
    work with .NET 4 then the following
    should fix this error:

    Open a command prompt and type the
    following set
    COMPLUS_ProfAPI_ProfilerCompatibilitySetting=EnableV2Profiler

    This instructs the .NET 4 CLR to load
    the .NET Framework 2.0 Profiler.

    For more information see:
    http://msdn.microsoft.com/en-us/library/dd778910.aspx

    at the end of the thread here

    which seems to solve my problem

    EDIT:

    it doesn’t solve my problem really. Now it just allows the coverage.xml to be generated, but it only contains the v2.0 framework assemblies, so only the .net 2.0 assemblies are profiled….

    Grrr. back to the drawing board…

    EDIT 2

    Hallelujah! I have figured this out by a process of random googling and changing. anyway, due to some pointers found here I was able to figure out that what I needed to do was to alter the exe.config of the application running the code (nunit.console-x86.exe in this case) file to not only force a specific version of the .net framework to be loaded but also to allow the legacy activation policy to be used. To cut a long story short I was able to solve this by:

    • Adding to the nunit-console-x86.exe.config the following section:
    <configuration>  
        <startup useLegacyV2RuntimeActivationPolicy="true">  
            <supportedRuntime version="v4.0.30319"/>  
        </startup>  
    </configuration>
    
    • setting these in the environment that the command is launched from:

      set ProfAPI_ProfilerCompatibilitySetting=EnableV2Profiler
      set COMPLUS_ProfAPI_ProfilerCompatibilitySetting=EnableV2Profiler
      (not sure both are necessary, but that’s what I did)

    I also added a similar setting to the NCover.Console.Exe.config, but it turns out that is unnecessary.

    EDIT 3

    this is the command line I am using (note that I copied all of ncover and nunit and my test assemblies into one directory to simplify things)

    NCover.Console.exe nunit-console-x86.exe /framework=4.0.30319 Your.Test.Assembly.dll //x coverage.xml //reg

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run .apk file from emulator but in the command line I
I want to run a shell command in Terminal, then clear the console, from
I want run a Bash script as root , but delayed. How can I
I want to run Eclipse Java Development Tools form source code, but I'm stuck
I want to run a weekly batch process in an asp.net page. How can
I want to run a command as soon as a certain text appears in
I want to run a background task that reads input from a TextReader and
I want to run an Apache on my local machine since I can only
I want to run a code on every postback on client-side. Is there an
I want to run a web application on php and mysql, using the CakePHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.