Error while executing 4.0 projects with NCover

Error while executing 4.0 projects with NCover

I have a Unit Test project which is developed on .Net 4.0 framework. I get the following error when i try to execute it using NCover explorer:

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'C:\Code\ABC\UnitTest\bin\ABC.UnitTest.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

The Environment details are: Runtime Environment - OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3 CLR Version: 2.0.50727.3053 ( Net 2.0 )

ProcessModel: Default DomainUsage: Single Execution Runtime: net-2.0

Please suggest a way to execute the Unit test and get the coverage.

Thanks & Regards, Pramod


RE: Error while executing 4.0 projects with NCover

Pramod,

Are you using NUnit? I experienced that same exception in NUnit and had to run NUnit with the /framework flag to get things working. I posted how I worked through the issue on NUnit 2.5.4 and 2.5.5 to the NUnit mailing list at http://groups.google.com/group/nunit-discuss/browse_thread/thread/9834bb6a9c641c2e.

If you would like, send me the full console output and I can let you know for sure if it's an NCover problem or not. support@ncover.com