After deploying our huge distributed system to one of our clients we experience an unexpected error. During the investigation we replace the assembly causing the error with
Had the same issue with a C# DLL containing a WCF client provided for multiple client applications.
Found out there was a method in the C# client library accessing the StackTrace for logging purposes, which happens to be different when compiled in debug.
StackTrace stackTrace = new StackTrace();
MethodBase methodBase = stackTrace.GetFrame(2).GetMethod();
GetFrame(2)
didn't existed in release. More info about that can be found here: StackTrace class methods not working in release mode
Funny thing is a VB.NET client was affected while in another C#.NET client it worked properly.
Hope it helps.