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 one where we have added some diagnostic code. The dll we use is built in debug mode. And suddenly it all works!
Replacing the debug dll with the release version (with the diagnostic code) makes it crash again.
There are no precompiler directives, conditional debug attributes etc. in our code. The problem has been found in two different installation sites, while it works fine in several more.
(The project has a mix of C# and VB.NET, the troublesom assembly is VB.NET.., if that makes any difference)
So the question is: What do you do in situations like this? And what can be the cause - in general? Any advice on debugging this issue is welcome.