3

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

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

I tried setting the current thread:

Thread.CurrentThread.ApartmentState = ApartmentState.STA

But that didn't help.

Is in not possible to use the WebBrowser control in ASP.NET?

Lea Cohen
  • 7,990
  • 18
  • 73
  • 99

1 Answers1

3

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

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

Stuart
  • 11,775
  • 6
  • 33
  • 31