In an attempt to create a 'System.InvalidOperationException: Cross-thread operation'
I came accros the strange behaviour that i would get an exception only in debug mode.

My test is like this:

  1. Create a view for some data with data binding to a model
  2. Create a separate thread (2) changing the model
  3. Databinding bubbles from the second thread to the UI control and the control throws an exception because it is being changed by a thread that did not create
    it.

Now this only was the case in Debug-mode. In release mode everything seemed fine. Seems there is a switch controlling this behaviour

Control.CheckForIllegalCrossThreadCalls that defaults to Debugger.IsAttached. For
a running application this exception is not thrown which might result in unexpected behaviour. By setting

Control.CheckForIllegalCrossThreadCalls = true 

the exception does occur.

See also: http://weblogs.asp.net/justin_rogers/archive/2004/10/08/240077.aspx