I believe the WebBrowser control is STA and a WCFservice hosted in a NT Service is MTA ?
Thanks.
I believe the WebBrowser control is STA and a WCFservice hosted in a NT
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Right, this likely will not work. The WebBrowser control was meant to be used by a single STA thread. It won’t map well to MTA in a web service, and will likely require some major hackery.
What are you trying to do? If you can describe your problem, we may be able to come up with an alternative solution.
edit
Ok, this is probably possible, although certainly hacky. Here’s a theoretical implementation:
The code would look something like this:
Also, a note from past experience: we’ve seen issues where the System.Windows.Forms.WebBrowser doesn’t navigate unless it’s added to a visual parent, e.g. a Form. Your mileage may vary. Good luck!