P
Peter Strøiman
Hi.
I have a very annoying problem. I have a very complex application that has
been converted from COM/COM+ C++ to C#.
The interface for my application is proprietary xml over http implemented
previously in an ASP page, now it is in an ASPX page.
The problem is my application uses a 3rd party COM object that has been
marked as an STA component. Therefore I have to run my business logic inside
an STA (until I get rid of this COM component).
I did manage to get it to work by implementing this code in my ASPX page
Thread thread = new Thread( new ThreadStart( execute ) );
thread.ApartmentState = ApartmentState.STA;
thread.Start();
while ( thread.ThreadState != ThreadState.Stopped )
Thread.Sleep( 100 );
The problem is, the debugger doesn't like this thread-change in my aspx
page. Somethimes it hangs for a minute, sometimes Visual Studio ( ver.
2003 ) crashes.
Therefore I'd like to know if it is possible to get asp.net to run page
handling inside an STA thread ( doesn't seem like it for what I've read -
but maybe there's a hidden switch )
Thanks in advance,
Peter Strøiman
I have a very annoying problem. I have a very complex application that has
been converted from COM/COM+ C++ to C#.
The interface for my application is proprietary xml over http implemented
previously in an ASP page, now it is in an ASPX page.
The problem is my application uses a 3rd party COM object that has been
marked as an STA component. Therefore I have to run my business logic inside
an STA (until I get rid of this COM component).
I did manage to get it to work by implementing this code in my ASPX page
Thread thread = new Thread( new ThreadStart( execute ) );
thread.ApartmentState = ApartmentState.STA;
thread.Start();
while ( thread.ThreadState != ThreadState.Stopped )
Thread.Sleep( 100 );
The problem is, the debugger doesn't like this thread-change in my aspx
page. Somethimes it hangs for a minute, sometimes Visual Studio ( ver.
2003 ) crashes.
Therefore I'd like to know if it is possible to get asp.net to run page
handling inside an STA thread ( doesn't seem like it for what I've read -
but maybe there's a hidden switch )
Thanks in advance,
Peter Strøiman