THE Server Threw an Exception

  • Thread starter Thread starter itsupport1
  • Start date Start date
I

itsupport1

Hello Experts,

I am having a problem in VB.net. I am using Multithreaded application. but
due to some reason I am getting this error message
"The Server Threw an Exception".
I can't understand from where that error message is coming.
Could anybody please why and from where ??

TIA

Rik
 
Hello Experts,

I am having a problem in VB.net. I am using Multithreaded application. but
due to some reason I am getting this error message
"The Server Threw an Exception".
I can't understand from where that error message is coming.
Could anybody please why and from where ??

TIA

Rik

By any chance are you using any COM objects on those other threads? If
you are, try setting the threads ApartmentState property to
ApartmentState.STA...

Dim t As New Thread (AddressOf YourThreadProc)
t.ApartmentState = ApartmentState.STA
t.Start ()

HTH
 
Thanks for your Prompt reply.
I am obviously using third party COM Object.

As I am executing the COM object in every thread concurrently from every
thread, so if I made it Single Thread, then is it not going to Create
problem for rest of threads who are executing it??

TIA

Rik
 
Thanks for your Prompt reply.
I am obviously using third party COM Object.

As I am executing the COM object in every thread concurrently from every
thread, so if I made it Single Thread, then is it not going to Create
problem for rest of threads who are executing it??

TIA

Rik

Rik,

I'm just guessing - based on similar experience :) - that the COM object
your are using is written as an STA component. It sounds like you are
creating the object on one thread and accessing it from multiple others,
try setting the thread the object is created on to STA.
 
Back
Top