CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2011
    Posts
    69

    Question ObjectExposedException was unhandled by user code

    This is the error I am getting when I try to load a page in the web browser. I am not sure if I am getting it cause I am loading the site beforehand in the background on a different web browser or what?:


    System.ObjectDisposedException was unhandled by user code
    Message: Cannot access a disposed object.
    Object name: 'WebBrowser'.

  2. #2
    Join Date
    Sep 2011
    Posts
    69

    Re: ObjectExposedException was unhandled by user code

    And this is what I get when I view the details of the error:

    The name '$exception' does not exist in the current context

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: ObjectExposedException was unhandled by user code

    Apparently you have some code trying to access $exception which has not been defined in the current context.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jan 2010
    Posts
    1,133

    Re: ObjectExposedException was unhandled by user code

    Actually, that sounds like a message from the Watch window of the debugger.
    More importantly: kytro360, if you look closer, it's not an ObjectExposedException, but an ObjectDisposedException.
    Quote Originally Posted by kytro360 View Post
    System.ObjectDisposedException was unhandled by user code
    Message: Cannot access a disposed object.
    Object name: 'WebBrowser'.
    Which means you're trying to access an unmanaged resource after it's been disposed of. Make sure you're using your objects properly. You may need to recreate the disposed objects, or make sure they are not disposed to soon.
    (The objects for which you still have references are disposed explicitly either by calling Dispose() on them, or by wrapping them in a using block. Also, container objects might call Dispose() on their components, when disposing themselves; you may need to check the docs, depending on what your code uses.)
    Last edited by TheGreatCthulhu; October 30th, 2011 at 09:11 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured