سؤال

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