Page Members not initialized

Page Members not initialized

am 04.04.2008 17:18:57 von kreissl

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

Re: Page Members not initialized

am 04.04.2008 17:53:48 von George Ter-Saakov

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:52a09f00-711f-492a-9f4a-cd8276954984@v32g2000prd.google groups.com...
> 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
>

Re: Page Members not initialized

am 04.04.2008 18:01:10 von NoSpamMgbworld

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:52a09f00-711f-492a-9f4a-cd8276954984@v32g2000prd.google groups.com...
> 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
>

Re: Page Members not initialized

am 04.04.2008 19:39:35 von kreissl

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

Re: Page Members not initialized

am 04.04.2008 20:54:47 von kreissl

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

Re: Page Members not initialized

am 05.04.2008 05:53:26 von NoSpamMgbworld

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:5820d8f0-bed2-4030-89ab-6dccbeb4c08b@j1g2000prb.googleg roups.com...
> 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

Re: Page Members not initialized

am 06.04.2008 12:43:01 von kreissl

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(s tring
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.resourc es.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