This is a migrated thread and some comments may be shown as answers.

Strange Exception

2 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
nima_montazeri
Top achievements
Rank 1
nima_montazeri asked on 23 Jan 2009, 05:03 PM
Hi,
I've got an error in my application. I have a TextBox in my user control that every time I want to read from it i'll get error and I can't even watch the value and debug it, for example when I try to add the TextBox to Watch Variables it shows following message:

 "Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. "

I would be happy if i have any answer from you
Best Regards
Nima

2 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 23 Jan 2009, 06:02 PM
Hey Nima,

Would you be able to post the code the the usercontrol and how it's being used?  Also, I found this on MSDN:

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/a8e01fde-6bdb-4344-8b64-b8d2f41597da/

Specifically towards the bottom, Gregg mentions some reasons for what is causing this.  Is the usercontrol you are using compiled, or are you using it as an ascx?
0
k f
Top achievements
Rank 1
answered on 24 Jan 2009, 03:30 PM
Hey Nima,

A shot in the dark but you do have your project/solution set to Debug and not release mode correct?  As indicated in the error, if you have your project set to release mode in Visual Studio you won't be able to debug it.

Please forgive me if that's obvious but I run into similar situations when I change to Release mode to build and publish a release and then forget to change back to Debug mode.

Tags
General Discussions
Asked by
nima_montazeri
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
k f
Top achievements
Rank 1
Share this question
or