Page Members not initialized

K

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
 
G

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.
 
C

Cowboy \(Gregory A. Beamer\)

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.
 
K

kreissl

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
 
K

kreissl

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
 
C

Cowboy \(Gregory A. Beamer\)

3.5 temp files under the 2.0 directory, as it is an add on to 2.0. Sorry for
not mentioning it.
 
K

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(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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top