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...
Quote:
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....
Quote: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.