문제

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"!?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top