Daily Usage Issues

Link issue when solution contains C++ projects

Started by NeilMacMullen on 1,932 views

I have a multi-project solution which includes a C++ DLL that is called by some C# unit tests.

I notice that Ncrunch tends to get confused if I edit the C++ source. This is quite easy to reproduce when editing header files that contain structure definitions. For example, adding a field to this C++ structure...


typedef struct
{
uint32_t number_of_initialisable_profiles; //add this field while Ncrunch is running
uint32_t active_profile;
uint32_t last_successful_profile;
uint32_t roam_threshold;
} cell_profile_selection_info_t;

causes this error....


NCrunch: This project was built on server '(local)'
CellProfileWrapper.obj (0, 0): metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (cell_profile_selection_info_t): (0x02000157).
LINK (0, 0): link failed because of metadata errors


(In case it's relevant, CellProfileWrapper.cpp contains a managed 'ref' class which is used to provide a shim to the C# unit tests and the structure is being consumed by both managed C++ and 'normal' C++.)

I accept this is a bit of a corner case for Ncrunch but it would nice if there was an easier way to work around it. At the moment it seems that:

* "reload and rebuild the project" doesn't fix it
* Disabling then re-enabling Ncrunch usually fixes it
* It's sometimes necessary to shut down and restart VS completely.




Hi, thanks for sharing this issue.

C++ isn't a supported language for NCrunch. We've done no real testing on usage of NCrunch with C++ based assemblies and cannot warrant that the product will work correctly with it. Any success with you have with it is entirely incidental.

Does compatibility mode make any difference here?

Post a reply

Log in to reply.