.net - Force NCover 1.5.8 to use v4 framework like testdriven.net does? -
i want run coverage command line, can't seem ncover 1.5.8 instrument code. must possible when run coverage tests testdriven.net works. difference seems td.net able ncover use framework 4.0 (you in log when runs : message: v4.0.30319
) command line can't make (i in log : message: v2.0.50727
)
so how can make ncover play nice nunit commandline, td.net?
after more searching found this:
if have found thread because trying ncover 1.5.8 work .net 4 following should fix error:
open command prompt , type following set complus_profapi_profilercompatibilitysetting=enablev2profiler
this instructs .net 4 clr load .net framework 2.0 profiler.
for more information see: http://msdn.microsoft.com/en-us/library/dd778910.aspx
at end of thread here
which seems solve problem
edit:
it doesn't solve problem really. allows coverage.xml generated, contains v2.0 framework assemblies, .net 2.0 assemblies profiled....
grrr. drawing board...
edit 2
hallelujah! have figured out process of random googling , changing. anyway, due pointers found here able figure out needed alter exe.config of application running code (nunit.console-x86.exe in case) file not force specific version of .net framework loaded allow legacy activation policy used. cut long story short able solve by:
- adding nunit-console-x86.exe.config following section:
<configuration> <startup uselegacyv2runtimeactivationpolicy="true"> <supportedruntime version="v4.0.30319"/> </startup> </configuration>
setting these in environment command launched from:
set profapi_profilercompatibilitysetting=enablev2profiler
set complus_profapi_profilercompatibilitysetting=enablev2profiler
(not sure both necessary, that's did)
i added similar setting ncover.console.exe.config, turns out unnecessary.
edit 3
this command line using (note copied of ncover , nunit , test assemblies 1 directory simplify things)
ncover.console.exe nunit-console-x86.exe /framework=4.0.30319 your.test.assembly.dll //x coverage.xml //reg
Comments
Post a Comment