Strange Exception

3 posts, 0 answers
  1. nima_montazeri
    nima_montazeri avatar
    4 posts
    Member since:
    Nov 2006

    Posted 23 Jan 2009 Link to this post

    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. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 23 Jan 2009 Link to this post

    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?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. k f
    k f avatar
    109 posts
    Member since:
    Jun 2006

    Posted 24 Jan 2009 Link to this post

    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.

Back to Top