One thing to try may be to apply STAThreadAttribute. See e.g.

[link:lorgonblog.wordpress.com]

for an example.

By on 10/12/2010 4:34 PM ()

Thanks, but that didn't make any difference.

By on 10/12/2010 4:47 PM ()

Next guess, try changing "let _ = " to "do".

By on 10/12/2010 8:11 PM ()

Still the same Exception.

By on 10/12/2010 8:14 PM ()

Ohhh, I bet window1 is being optimized away by the compiler as a field, so whatever magic on the Builder.Object attribute or something is unused.

Try adding e.g.

member this.Whatever() = window1

or some member that will force realization of window1 as a class field rather than just a local variable inside the constructor.

By on 10/12/2010 8:19 PM ()

Thanks so much, that was the problem!

By on 10/12/2010 8:31 PM ()

Hurray!

(Lest anyone think this is an implementation artifact of the compiler, it is actually part of the language spec, section 8.6.2

“let” and “do” Declarations in Primary Constructors

[link:research.microsoft.com]

)

By on 10/12/2010 8:41 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper