Using WebBrowser Control in an ASP.NET Application

I want to create site thumbnails through my web application, so I decided to use the WebBrowser control. However, I get the error message:

System.Threading.ThreadStateException: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be created because the current thread is not in a single-threaded apartment.

I tried to set the current thread:

Thread.CurrentThread.ApartmentState = ApartmentState.STA

But it did not help.

Can't use the WebBrowser control in ASP.NET?

+3
source share
1 answer

YES, you can use it, it's a bit more complicated than setting AspCompat = "true", see if that helps

http://www.beansoftware.com/ASP.NET-Tutorials/Get-Web-Site-Thumbnail-Image.aspx

+3

Source: https://habr.com/ru/post/1711425/


All Articles