Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Has anyone encountered an unhandled exception being thrown while stepping through the debugger? When this happends I am inside a newly created thread and the function I am in is the one pointed at by the addressof(myThread = New System.Threading.Thread(AddressOf postdata). In this case I am in postdata.

 

The message I am receiving while stepping through the debugger is:

 

"An unhandled exception of type 'System.Threading.ThreadStopException' occured in CreditBureauHTTPS.exe

 

Additional Information: Thread was being stopped."

 

I have executed the same code with no problems on two separate machines that are identical to the one I am using. One of the machines has the same version of the IDE and Framework.

 

I am running Visual Studio 2003 with Framework 1.1.

 

At one point in time, I was able to use the debugger to step through.

 

I have since uninstalled and reinstalled the IDE. No luck.

 

Any help is greatly appreciated.

 

Thanks in advance

Posted
It's back. Help! I was stepping through the code after working for several hours and it just started throwing the exception again. Anyone know how to trap why the thread is being stopped? I believe I have try catches where I need them, so I do not see how I could programmatically catch it.
  • *Experts*
Posted
Is it crashing at the same point every time? Do you have some sort of anti-virus program or something that could be attempting to stop your program's thread (unlikely...).
  • 2 months later...
Posted

Just to let you know I just got this problem now too; It just came out of the blue. (I've never had this problem before)

 

I'm using VS.NET 2003 (Architect) with .NET Framework 1.1 as well...

 

I'll keep you posted if I find a solution...

 

Max

Posted

What about VolteFace asked?

 

Do u have any AV or FireWall active?

Did you made you thread safe?

Software bugs are impossible to detect by anybody except the end user.
  • *Experts*
Posted

This is weird... I can't find any info on ThreadStopException in my MSDN, and Google turns up only 15 pages about it, one of them being this thread.

 

Are you using any third party DLLs or anything?

Posted

In form load

 

testthread = New Thread(AddressOf test)

testthread.Name = "test"

testthread.Start()

 

 

Private Sub test()

Dim a As String = "wrew"

Me.Text = "Test" 'crashes here

TextBox1.Text = "test"

Debug.WriteLine("test")

End Sub

 

This code works fine on my other PC and timers work fine.

  • Administrators
Posted
Is the sub attempting to update the UI? If so that is probably the problem. UI elements should only be modified from the forms main thread. Search these forums for some examples on using Form.Invoke - not near VS at the moment so I can't dig up the help.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

I've asked you that before ...

 

When using threads allways make them ThreadSafe, use delegates for example... specially if the thread modifies th UI...

 

:D

Software bugs are impossible to detect by anybody except the end user.
  • 4 months later...
Posted (edited)

smae prob not modifying ui or using threads

 

I don't yet know how to use threads in .net so maybe I'm inadvetently doing something with them though I have no code that deals with threads at all.

 

The class(3) containing the following code is called by a class(2) which is called by the UI form(1), with no attempt to modify or update the UI(1) directly.

 

class3

................

..

cls4 = New class4(temp, sOutputFile, iPageNo, iSideLength, blChosenSide)

'Thread Was Being Stopped' exception occurs here

cls4.Make()

................

end class

 

Class(2) however does raise an event that allows the UI(1) to refresh itself.

 

class2

................

..

Dim cls3 As new class3(sInputFile, sOutputFile)

cls3.Make()

cls3.dispose()

cls3 = Nothing

RaiseEvent done(Me, sOutputFile)' in this event's handler, the UI(1) calls its refresh method

................

end class

 

(The identifier names have been simplified and much code ommitted for readbility)

 

The same exception is thrown ad I don't know why.

 

Please,

help me.

 

 

ps I just reallised that the acrobat interop which I'm using may be using threads. Any help with this would be great as I'm not controlling the threading in the COM if it is using it.

 

Also the word printing system is used prior to this code which may also use threading, D'oh!

 

Cheers Will

Edited by willg
  • 5 months later...
Posted
It might be too late but can help others. One way of overcoming this is to hide your local and auto windows in the IDE. This way I managed to step through in my code in the IDE.
  • 3 months later...
Posted

Hi everyone,

I had this same error which had me going for about a day. After reading gyurisc's comment about the debugging windows, I cleared all the watches I had going in my window and all of a sudden the error disappeared and my step through performance came back.

 

Just in case anyone else has this problem, try doing that.

 

Thanks,

Simon

  • 11 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...