Question

Does anybody know how to do coverage of an C++/CLI class using NCover?

NCover only measures coverage of an assembly if it finds a matching .pdb file.

However, my C++/CLI project does not output a .pdb file.

If I go to "Visual Studio -> Configuration Properties -> C/C++ -> Output Files -> Program Database File Name" and set it to "MyDll.pdb" it actually outputs a file called "MyDLL.idb"!?

Was it helpful?

Solution

Yeah, confuzzling setting. It is actually a linker setting: Linker, Debugging, Generate Program Database File. Make sense if you think about it, only after linking are all object files combined and can debug info be created.

Not sure why you'd have to jump through this hoop, the default settings in the Debug configuration ensure that a .pdb file is created. Ought to be good enough for NCover, I'd imagine.

OTHER TIPS

Are you compiling a Release build, or Debug build? As Hans mentioned, the default settings for Debug will generate a .pdb that NCover can use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top