displaying a WPF Window from a System.Configuration.Install.Installer class
Posted
by cbeuker
on Stack Overflow
See other posts from Stack Overflow
or by cbeuker
Published on 2010-05-17T23:35:26Z
Indexed on
2010/05/17
23:40 UTC
Read the original article
Hit count: 179
Greetings all,
I have a question. I have created a WPF application. So, I naturally created an installer (Visual Studio Install project) for it.
In the Commit section of the installer I want to launch a WPF window which is my configuration wizard.
So I created a Installer class, overrode the Commit method and put the following in method:
Application theApp = new Application;
theApp.Run (new MyWPFWizardWindow());
I keep getting the error:
The calling thread must be STA, because many UI components require this.
No problems, this makes as it is a GUI application. But I can't, for the life of me, get the installer to fire up my window. I have tried putting [STAThread] on the method. I have tried firing up a thread and setting the ApartmentState to STA. I am guessing it's something really simple that I am over looking. Anyone have any thoughts?
Thanks in advance..
cmb..
© Stack Overflow or respective owner