How can I use Winforms WebBrowser control in webapp?
I developed a library for HTML control to fit our needs with a WebBrowser control, but I need this library to work in a web application, not a winforms application. The main problem I am getting is this:
The "ActiveX control" 8856f961-340a-11d0-a96b-00c04fd705a2 "could not be created because the current thread is not in a single-threaded apartment."
I understand this is because the WebBrowser control needs to run on an STA thread, but obviously the web application is not an STA. Its a server side process, although not on the page itself. Any ideas on how I can get around this? I decided to set the AspCompat = "true" attribute on the page tag of the hidden page and run it, but I would have preferred a more elegant solution.
Greetings
a source to share
Create and execute your work in a new thread where you have explicitly set ApartmentState via SetApartmentState () .
a source to share