I know a lot of time has passed since this problem was discussed, however, I got the same error with WPF today. It turned out that when I set DialogResult twice, I got this error on the second setting. DialogResult did not behave like a storage location that one sets values to multiple time. The error message that results is very misleading. A similar situation was discussed in this chain of answers, however, in my case I was setting DialogResult to "true" both times, to the same value.