By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,471 Members | 722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,471 IT Pros & Developers. It's quick & easy.

THE Server Threw an Exception

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 2004-12-21, itsupport1 <it**********@wells.co.nz> wrote:
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
--
Tom Shelton [MVP]
Nov 21 '05 #2

P: n/a
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
"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> wrote in message
news:Of****************@TK2MSFTNGP14.phx.gbl...
On 2004-12-21, itsupport1 <it**********@wells.co.nz> wrote:
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
--
Tom Shelton [MVP]

Nov 21 '05 #3

P: n/a
On 2004-12-21, itsupport1 <it**********@wells.co.nz> wrote:
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.

--
Tom Shelton [MVP]
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.