Page Members not initialized

Discussion in 'ASP .Net' started by kreissl@gmail.com, Apr 4, 2008.

  1. Guest

    Hello,

    i am really confused. I am working on a ASP.NET project. Language VB,
    Framework 3.5. I want to describe the behavior:

    Calling a page (including datagrid and a userctrl) I get zero pointer
    exceptions. When start the project in debug mode I can see that all
    members and fields of the page like Master and so on are all nothing,
    including that ones that cannot be zero / nothing!

    Now the weird thing: When I make a breakpoint (in my case in preinit)
    all instances of the page are created fine and the page is loaded :/

    Does anybody has heard of that problem? And I tried long to figure it
    out, but the strange thing is that I did not work on that part of the
    project. It was like from one day to the other day that that error
    appeared. And its the same in release version. Also the designer shows
    the page without errors and the partial designer class looks fine
    too.

    thanks for all hints,

    Holger
     
    , Apr 4, 2008
    #1
    1. Advertising

  2. Sorry but you will have to rephrase...
    I can not make sence out of folowing statements that almost contradict each
    other

    1.
    >"When start the project in debug mode I can see that all
    > members and fields of the page like Master and so on are all nothing"


    2.
    >Now the weird thing: When I make a breakpoint (in my case in preinit)
    > all instances of the page are created fine and the page is loaded :/



    In case #1 how do you see all members and fields if you did not set
    breakpoint? Page object initializes only when called (via browser) and
    disposed immediatelly once HTML is rendered.
    Hence you need to break somewere between those 2 events to see all members
    and fields.

    So pretty much behavior is expected given you can explain what you mean by
    "I can see that all members and fields of the page ..." in #1...


    George.


    <> wrote in message
    news:...
    > Hello,
    >
    > i am really confused. I am working on a ASP.NET project. Language VB,
    > Framework 3.5. I want to describe the behavior:
    >
    > Calling a page (including datagrid and a userctrl) I get zero pointer
    > exceptions. When start the project in debug mode I can see that all
    > members and fields of the page like Master and so on are all nothing,
    > including that ones that cannot be zero / nothing!
    >
    > Now the weird thing: When I make a breakpoint (in my case in preinit)
    > all instances of the page are created fine and the page is loaded :/
    >
    > Does anybody has heard of that problem? And I tried long to figure it
    > out, but the strange thing is that I did not work on that part of the
    > project. It was like from one day to the other day that that error
    > appeared. And its the same in release version. Also the designer shows
    > the page without errors and the partial designer class looks fine
    > too.
    >
    > thanks for all hints,
    >
    > Holger
    >
     
    George Ter-Saakov, Apr 4, 2008
    #2
    1. Advertising

  3. The first thing I would do is run through all of the page events and make
    sure you did not unwittingly destroy the page through code you added.

    I would then step through the entire page (possibly even into the .NET code
    (http://tinyurl.com/yqsokg)) and see where the values are getting munged.

    Another option is to manually clear out the ASP.NET temporary files, found
    under %WIN_DIR%/Microsoft .Net/Framework/v{version number}/Temporary ASP.NET
    Files. If anything is munged there, please post back, as I have been
    following issues with files here and informally cataloguing them (have
    posted one bug based on them).

    Worst case, exclude the page and set up a new page with the same code. You
    can do this with a simple copy and paste operation. If this works, then .NET
    is holding something somewhere.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://gregorybeamer.spaces.live.com/lists/feed.rss

    or just read it:
    http://gregorybeamer.spaces.live.com/

    *************************************************
    | Think outside the box!
    |
    *************************************************
    <> wrote in message
    news:...
    > Hello,
    >
    > i am really confused. I am working on a ASP.NET project. Language VB,
    > Framework 3.5. I want to describe the behavior:
    >
    > Calling a page (including datagrid and a userctrl) I get zero pointer
    > exceptions. When start the project in debug mode I can see that all
    > members and fields of the page like Master and so on are all nothing,
    > including that ones that cannot be zero / nothing!
    >
    > Now the weird thing: When I make a breakpoint (in my case in preinit)
    > all instances of the page are created fine and the page is loaded :/
    >
    > Does anybody has heard of that problem? And I tried long to figure it
    > out, but the strange thing is that I did not work on that part of the
    > project. It was like from one day to the other day that that error
    > appeared. And its the same in release version. Also the designer shows
    > the page without errors and the partial designer class looks fine
    > too.
    >
    > thanks for all hints,
    >
    > Holger
    >
     
    Cowboy \(Gregory A. Beamer\), Apr 4, 2008
    #3
  4. Guest

    On 4 Apr., 17:53, "George Ter-Saakov" <> wrote:
    > Sorry but you will have to rephrase...
    > I can not make sence out of folowing statements that almost contradict each
    > other


    > In case #1 how do you see all members and fields if you did not set
    > breakpoint? Page object initializes only when called (via browser) and
    > disposed immediatelly once HTML is rendered.


    Because the debugger fetches the exception an breaks at the first null
    pointer exception.
    In my code is that a usercontrol. There I can watch "me" and see that
    all members including Master are not initialized...

    ty holger
     
    , Apr 4, 2008
    #4
  5. Guest

    On 4 Apr., 18:01, "Cowboy \(Gregory A. Beamer\)"
    <> wrote:
    > The first thing I would do is run through all of the page events and make
    > sure you did not unwittingly destroy the page through code you added.
    >
    > I would then step through the entire page (possibly even into the .NET code
    > (http://tinyurl.com/yqsokg)) and see where the values are getting munged.
    >
    > Another option is to manually clear out the ASP.NET temporary files, found
    > under %WIN_DIR%/Microsoft .Net/Framework/v{version number}/Temporary ASP.NET
    > Files. If anything is munged there, please post back, as I have been
    > following issues with files here and informally cataloguing them (have
    > posted one bug based on them).
    >
    > Worst case, exclude the page and set up a new page with the same code. You
    > can do this with a simple copy and paste operation. If this works, then .NET
    > is holding something somewhere.



    Ty for the reply. The .NET debugger brought not much... Will try it
    tomorrow again.
    The 3.5 directory has no temporary folder. Maybe its located somewhere
    else?
    If nothing works I will have to make the page again.
    holger
     
    , Apr 4, 2008
    #5
  6. 3.5 temp files under the 2.0 directory, as it is an add on to 2.0. Sorry for
    not mentioning it.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://gregorybeamer.spaces.live.com/lists/feed.rss

    or just read it:
    http://gregorybeamer.spaces.live.com/

    *************************************************
    | Think outside the box!
    |
    *************************************************
    <> wrote in message
    news:...
    > On 4 Apr., 18:01, "Cowboy \(Gregory A. Beamer\)"
    > <> wrote:
    >> The first thing I would do is run through all of the page events and make
    >> sure you did not unwittingly destroy the page through code you added.
    >>
    >> I would then step through the entire page (possibly even into the .NET
    >> code
    >> (http://tinyurl.com/yqsokg)) and see where the values are getting munged.
    >>
    >> Another option is to manually clear out the ASP.NET temporary files,
    >> found
    >> under %WIN_DIR%/Microsoft .Net/Framework/v{version number}/Temporary
    >> ASP.NET
    >> Files. If anything is munged there, please post back, as I have been
    >> following issues with files here and informally cataloguing them (have
    >> posted one bug based on them).
    >>
    >> Worst case, exclude the page and set up a new page with the same code.
    >> You
    >> can do this with a simple copy and paste operation. If this works, then
    >> .NET
    >> is holding something somewhere.

    >
    >
    > Ty for the reply. The .NET debugger brought not much... Will try it
    > tomorrow again.
    > The 3.5 directory has no temporary folder. Maybe its located somewhere
    > else?
    > If nothing works I will have to make the page again.
    > holger
     
    Cowboy \(Gregory A. Beamer\), Apr 5, 2008
    #6
  7. Guest

    I have a working site know.. But i am not really happy.. I moved the
    code from pre_init to page_load. Now it looks like the error is gone.
    I tried to clear the temporary asp files and I created a new page...
    That did not work. So it looks like that for some reason the page
    doesnt init correct. I tried to debug it but that doesnt make really
    sence, because like i said, when I breakpoint in pre_init everything
    looks fine... Only when it runs without the breakpoint the objects
    there are uninitialized and the exceptions are caused.

    Than I am not sure if it has something to do with the clearing of the
    asp temp folder or if its normal because of the new .net debugger
    settings. I get tonns of first chance exceptions after first project
    start (when webserver starts first time). The first comes in
    mscorlib.dll!
    System.Globalization.CultureTableRecord.CultureTableRecord(string
    cultureName, bool useUserOverride) Line 756: Culturename
    "uploads" ???


    A first chance exception of type 'System.Net.Sockets.SocketException'
    occurred in System.dll
    A first chance exception of type 'System.TypeLoadException' occurred
    in System.Web.dll
    'WebDev.WebServer.EXE' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL
    \System.resources\2.0.0.0_de_b77a5c561934e089\System.resources.dll'
    A first chance exception of type 'System.TypeLoadException' occurred
    in System.Web.dll
    .... (about 100 times ;)
    A first chance exception of type 'System.TypeLoadException' occurred
    in System.Web.dll
    'WebDev.WebServer.EXE' (Managed): Loaded 'C:\Windows\Microsoft.NET
    \Framework\v2.0.50727\Temporary ASP.NET Files\root
    \dc083b87\b1353192\App_Web_ur8tsq9t.dll', Symbols loaded.
    A first chance exception of type 'System.TypeLoadException' occurred
    in System.Web.dll

    When i break into such an exception its something like:

    Type System.Web.UI.WebControls.WebParts.ContentPlaceHolder in Assembly
    System.Web, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a could not be loaded.
    Type System.Web.UI.ContentPlaceHolder in der Assembly
    System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35 could not be loaded.
    Type System.Web.UI.Image in der Assembly System.Web.Extensions,
    Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ...

    Maybe its a normal behavior and I can ignore it. But i am interessted
    in the reasons for that...


    Other Question: It doesnt save the symbols permanent. Should it? I
    need to click Load Symbols every time, also when I still loaded it in
    a previos session.

    thanks a lot for all replys

    holger
     
    , Apr 6, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven T. Hatton
    Replies:
    4
    Views:
    417
    Siemel Naran
    Aug 27, 2004
  2. lovecreatesbeauty
    Replies:
    43
    Views:
    1,313
    Keith Thompson
    Feb 6, 2006
  3. Olumide
    Replies:
    4
    Views:
    547
    James Kanze
    Dec 9, 2007
  4. Immortal Nephi
    Replies:
    15
    Views:
    6,530
    Bo Persson
    Jul 23, 2010
  5. Skybuck Flying
    Replies:
    2
    Views:
    2,627
    Alf P. Steinbach /Usenet
    Jun 21, 2011
Loading...

Share This Page