THE Server Threw an Exception

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
 
T

Tom Shelton

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
 
I

itsupport1

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
 
T

Tom Shelton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top