You have a bug that is obscured somehow in the debug version.
In C#, the most common way for this to happen is to explicitly contain
some code with "#if DEBUG", since the usual "uninitialized variable" stuff
doesn't come up (heap-allocated stuff is always initialized to default
values and local variables are required by the compiler to be initialized
before use). However, you might have some debug-related code (for
example, using the Debug.Assert() method where the clause in the method
has a side-effect). This is not an exclusive list, but is the most common
ways I can think of that might cause this sort of thing.
Finding the exact problem might be tricky, but frankly since you have a
reproducible crash in the release version, why not just run the release
version under the de *** and take a look at the crash? See what's wrong
and think about what code should be making it right and why that code
might not be executing, or might be doing the wrong thing, under the
release version of the build.