Hi,
I think I am having some threading issues in a project I am porting from VB6
webclass to VB.NET.
Therefore I would like to temporarily set the threading mode to STA to get
around it until I have
fully ported and tested all code.
I have class that implement IHttpFactory, thus I have a GetHandler method.
However if I try to use the [STAThread] directive, like this:
Public Class MyFactory Implements IHttpHandler
[STAThread] Public Overridable Function GetHandler( ..... )
.... I then get the error that I haven't implemented GetHandler.
If as the first line of my GetHandler implementation I say:
CurrentThread.ApartmentState = CurrentThread.AppartmentState.STA
Then it does not change the threading model used it stays on MTA.
Anybody have any ideas on how I might achieve this?
Regards,
Peter