To work around this problem, make sure that the instantiating thread runs in an STA.
If you use the MTAThread attribute to specify that the main thread of the host application runs in an MTA,you must use the STAThread attribute instead. To do this, replace the code of 'MTAThread' with the following code:
<STAThread()> _