Call to methods defined in a class library crashes

Nov 11 2014 2:02 PM
Hello all,
  I have just come back to C# after a long absence.
  I was working on a class library that I wrote  whose purpose is to call unmanaged code I have written in C. It uses P/invoke.
I'm using Visual Studio Express for Desktop 2013. 
Initially I had a single solution with two projects:
  • one for the class library and
  • one for a demo program that calls on this library.
 In the demo project I added 
a reference to the class library, and that is also where I put the unmanaged DLL's I was calling.  This seems to work fine.
 
But then management said, "We cant give them the sources of our class library, so why dont you create two solutions:
one that creates the DLL, and one for the demo (a console application), and we shall ship the Demo solution along with the DLL's (managed and unmanaged)."
 
So now, in the Demo solution I created a subdirectory named Dependencies and copied the DLL's into that, and I tried adding a reference to thsi occurence of the managed DLL.  In  the demo solution 's Object Explorer I can indeed see the names of these class methods. The problem is that the application crashes as soon at it reaches a call to the library methods (static methods, by the way). The crash is not accompanied by any message at all.
 
All was working fine in one solution, why is it crashing this way? Am I misunderstanding what a reference is?

Answers (2)