The title almost explains the whole problem. I already wasted many hours to solve this problem but I don't seem to get to the bottom of it.
I have an unmanaged DLL that I try to call in a C# application.
[DllImport("MyTest.dll")]
private static extern int DoSomething([MarshalAs(UnmanagedType.LPStr)] String text, int number)
If I call this DLL in a Console Application (Platform: 32 bit + unmanaged code debugging) everything works fine. If I disable the "unmanaged code debugging" the app silently crashes without any exception during debug.
If I call this DLL in a Webservice in Visual Studio (Platform: 32 bit + unmanaged code debugging) it just "crashes" without any exception. The debugging just stops and the Webservice stops running. If I disable "unmanaged code debugging" I get an "IIS has stopped working" exception. So no matter what I do I don't get an exception that is of any use for me.
Has anybody an idea what I could do to get more information about this problem? Why is it running in a Console Application but not on my IIS?