By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

getting 'Object reference not set to an instance' some times

P: n/a
Hello,

I am getting this error once in a while from my web
sites. When I will refresh web browser, it goes off and
sites are working fine.

Directory structures and file names are as below-

C:\WWW - corporate site, C:\WWW\default.aspx is the
default page and this site works fine.
C:\Content\www is a virtual directory(/content) on the
site from where all ASPX files (other than default.aspx)
are referenced. All other files in \WWW are ASP pages. So
\WWW has a \bin directory, which has all ASPX Dlls.

C:\Content\div1.aspx
C:\Content\div2.aspx
C:\Content\div3.aspx
C:\Content\div4.aspx
........ are our divisional site home pages [with
different divisional site IPs]. \content is also a virtul
directory (\content\www) for all divisional sites, so we
have bin directory copied in \content and \content\www as
well.

Error description-
[NullReferenceException: Object reference not set to an
instance of an object.]
Admin.Global.Application_Start(Object sender,
EventArgs e) +347

Anybody has any idea of what is happening?

Thanks in advance - Binoy
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
I would start by looking at "Admin.Global.Application_Start(Object sender,
EventArgs e)" - Line 347

Could you post that?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Binoy" <an*******@discussions.microsoft.com> wrote in message
news:a0****************************@phx.gbl...
Hello,

I am getting this error once in a while from my web
sites. When I will refresh web browser, it goes off and
sites are working fine.

Directory structures and file names are as below-

C:\WWW - corporate site, C:\WWW\default.aspx is the
default page and this site works fine.
C:\Content\www is a virtual directory(/content) on the
site from where all ASPX files (other than default.aspx)
are referenced. All other files in \WWW are ASP pages. So
\WWW has a \bin directory, which has all ASPX Dlls.

C:\Content\div1.aspx
C:\Content\div2.aspx
C:\Content\div3.aspx
C:\Content\div4.aspx
....... are our divisional site home pages [with
different divisional site IPs]. \content is also a virtul
directory (\content\www) for all divisional sites, so we
have bin directory copied in \content and \content\www as
well.

Error description-
[NullReferenceException: Object reference not set to an
instance of an object.]
Admin.Global.Application_Start(Object sender,
EventArgs e) +347

Anybody has any idea of what is happening?

Thanks in advance - Binoy

Nov 18 '05 #2

P: n/a
Kevin,

Really Global.asax.vb has only 142 lines.

Thanks
-Binoy
-----Original Message-----
I would start by looking at "Admin.Global.Application_Start(Object sender,EventArgs e)" - Line 347

Could you post that?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Binoy" <an*******@discussions.microsoft.com> wrote in messagenews:a0****************************@phx.gbl...
Hello,

I am getting this error once in a while from my web
sites. When I will refresh web browser, it goes off and
sites are working fine.

Directory structures and file names are as below-

C:\WWW - corporate site, C:\WWW\default.aspx is the
default page and this site works fine.
C:\Content\www is a virtual directory(/content) on the
site from where all ASPX files (other than default.aspx) are referenced. All other files in \WWW are ASP pages. So \WWW has a \bin directory, which has all ASPX Dlls.

C:\Content\div1.aspx
C:\Content\div2.aspx
C:\Content\div3.aspx
C:\Content\div4.aspx
....... are our divisional site home pages [with
different divisional site IPs]. \content is also a virtul directory (\content\www) for all divisional sites, so we have bin directory copied in \content and \content\www as well.

Error description-
[NullReferenceException: Object reference not set to an
instance of an object.]
Admin.Global.Application_Start(Object sender,
EventArgs e) +347

Anybody has any idea of what is happening?

Thanks in advance - Binoy

.

Nov 18 '05 #3

P: n/a
Well, the number of lines in your Application+Start method should be even
smaller. What development environment are you using?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"bINOY" <an*******@discussions.microsoft.com> wrote in message
news:a1****************************@phx.gbl...
Kevin,

Really Global.asax.vb has only 142 lines.

Thanks
-Binoy
-----Original Message-----
I would start by looking

at "Admin.Global.Application_Start(Object sender,
EventArgs e)" - Line 347

Could you post that?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Binoy" <an*******@discussions.microsoft.com> wrote in

message
news:a0****************************@phx.gbl...
Hello,

I am getting this error once in a while from my web
sites. When I will refresh web browser, it goes off and
sites are working fine.

Directory structures and file names are as below-

C:\WWW - corporate site, C:\WWW\default.aspx is the
default page and this site works fine.
C:\Content\www is a virtual directory(/content) on the
site from where all ASPX files (other than default.aspx) are referenced. All other files in \WWW are ASP pages. So \WWW has a \bin directory, which has all ASPX Dlls.

C:\Content\div1.aspx
C:\Content\div2.aspx
C:\Content\div3.aspx
C:\Content\div4.aspx
....... are our divisional site home pages [with
different divisional site IPs]. \content is also a virtul directory (\content\www) for all divisional sites, so we have bin directory copied in \content and \content\www as well.

Error description-
[NullReferenceException: Object reference not set to an
instance of an object.]
Admin.Global.Application_Start(Object sender,
EventArgs e) +347

Anybody has any idea of what is happening?

Thanks in advance - Binoy

.

Nov 18 '05 #4

P: n/a
Kevin,

We are working on Visual Studio .NET 2003 / Framework 1.1
on Windows XP desktops.

Server is Windows 2000 server with Framework 1.1.

I searched Google and came across with only questions -
No answers.

Thanks
-Binoy
-----Original Message-----
Well, the number of lines in your Application+Start method should be evensmaller. What development environment are you using?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"bINOY" <an*******@discussions.microsoft.com> wrote in messagenews:a1****************************@phx.gbl...
Kevin,

Really Global.asax.vb has only 142 lines.

Thanks
-Binoy
>-----Original Message-----
>I would start by looking

at "Admin.Global.Application_Start(Object sender,
>EventArgs e)" - Line 347
>
>Could you post that?
>
>--
>HTH,
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>
>"Binoy" <an*******@discussions.microsoft.com> wrote in

message
>news:a0****************************@phx.gbl...
>> Hello,
>>
>> I am getting this error once in a while from my web
>> sites. When I will refresh web browser, it goes off and >> sites are working fine.
>>
>> Directory structures and file names are as below-
>>
>> C:\WWW - corporate site, C:\WWW\default.aspx is the
>> default page and this site works fine.
>> C:\Content\www is a virtual directory(/content) on the >> site from where all ASPX files (other than

default.aspx)
>> are referenced. All other files in \WWW are ASP pages.
So
>> \WWW has a \bin directory, which has all ASPX Dlls.
>>
>> C:\Content\div1.aspx
>> C:\Content\div2.aspx
>> C:\Content\div3.aspx
>> C:\Content\div4.aspx
>> ....... are our divisional site home pages [with
>> different divisional site IPs]. \content is also a

virtul
>> directory (\content\www) for all divisional sites,
so we
>> have bin directory copied in \content and
\content\www as
>> well.
>>
>> Error description-
>> [NullReferenceException: Object reference not set

to an >> instance of an object.]
>> Admin.Global.Application_Start(Object sender,
>> EventArgs e) +347
>>
>> Anybody has any idea of what is happening?
>>
>> Thanks in advance - Binoy
>
>
>.
>

.

Nov 18 '05 #5

P: n/a
Hi Binoy,

I can tell you a couple of things for certain. The error is occurring in
your Application_Start Event handler. The resson refreshing the browser
makes the error go away is that the Application_Start method only fires when
the Application starts, which would happen rarely, and certainly NOT after a
page is refreshed. So, the intermittent part is that the Application_Start
method is only fired intermittently.

The error message indicates that there is a reference to an object in that
method, an object which has not been instantiated in any way. If you post
your Application_Start code I can take a wild guess as to the line that
threw the exception.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Binoy" <an*******@discussions.microsoft.com> wrote in message
news:b6****************************@phx.gbl...
Kevin,

We are working on Visual Studio .NET 2003 / Framework 1.1
on Windows XP desktops.

Server is Windows 2000 server with Framework 1.1.

I searched Google and came across with only questions -
No answers.

Thanks
-Binoy
-----Original Message-----
Well, the number of lines in your Application+Start

method should be even
smaller. What development environment are you using?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"bINOY" <an*******@discussions.microsoft.com> wrote in

message
news:a1****************************@phx.gbl...
Kevin,

Really Global.asax.vb has only 142 lines.

Thanks
-Binoy

>-----Original Message-----
>I would start by looking
at "Admin.Global.Application_Start(Object sender,
>EventArgs e)" - Line 347
>
>Could you post that?
>
>--
>HTH,
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>
>"Binoy" <an*******@discussions.microsoft.com> wrote in
message
>news:a0****************************@phx.gbl...
>> Hello,
>>
>> I am getting this error once in a while from my web
>> sites. When I will refresh web browser, it goes off and >> sites are working fine.
>>
>> Directory structures and file names are as below-
>>
>> C:\WWW - corporate site, C:\WWW\default.aspx is the
>> default page and this site works fine.
>> C:\Content\www is a virtual directory(/content) on the >> site from where all ASPX files (other than
default.aspx)
>> are referenced. All other files in \WWW are ASP pages. So
>> \WWW has a \bin directory, which has all ASPX Dlls.
>>
>> C:\Content\div1.aspx
>> C:\Content\div2.aspx
>> C:\Content\div3.aspx
>> C:\Content\div4.aspx
>> ....... are our divisional site home pages [with
>> different divisional site IPs]. \content is also a
virtul
>> directory (\content\www) for all divisional sites, so we
>> have bin directory copied in \content and \content\www as
>> well.
>>
>> Error description-
>> [NullReferenceException: Object reference not set to an >> instance of an object.]
>> Admin.Global.Application_Start(Object sender,
>> EventArgs e) +347
>>
>> Anybody has any idea of what is happening?
>>
>> Thanks in advance - Binoy
>
>
>.
>

.

Nov 18 '05 #6

P: n/a
Kevin,

Here's my App Start -

Sub Application_Start(ByVal sender As Object,
ByVal e As EventArgs)
' Fires when the application is
started,Assign the application variables from the
web.config file
Application("Invalid_Permissions_Page") =
ConfigurationSettings.AppSettings.Item
("Invalid_Permissions_Page").ToString()
Application("Aspx_Error_File") =
ConfigurationSettings.AppSettings.Item
("Aspx_Error_File").ToString()
Application("Images_Virtual_Path") =
ConfigurationSettings.AppSettings.Item
("Images_Virtual_Path").ToString()
Application("strAspxDefaultFile") =
ConfigurationSettings.AppSettings.Item
("Aspx_Default_File").ToString()
Application("DD_Menu_XML_CSS_File_Path") =
ConfigurationSettings.AppSettings.Item
("DD_Menu_XML_CSS_File_Path").ToString()
Application("DDMenuImagePath") =
ConfigurationSettings.AppSettings.Item
("DD_Menu_Image_Path").ToString()

Dim objblTopSection As New
myrootnamespace.Templates.blTemplateImageSection
Dim dtSupTopControl As DataTable
Dim intSupplierId As Integer
intSupplierId =
myrootnamespace.Utility_Manager.CommonFunctions.Ge tSupplie
rID(HttpContext.Current.Request.Url.GetLeftPart
(Uri_Partial.Authority))
dtSupTopControl =
objblTopSection.RetreiveCustomSupplierTop(intSuppl ierId)

Application("CustomizeTopNav") =
dtSupTopControl.Rows(0).Item("Customize")
If Not dtSupTopControl.Rows(0).IsNull
("CustomPageSize") Then
Application("CustomPageSize") =
dtSupTopControl.Rows(0).Item("CustomPageSize")
Else
Application("CustomPageSize") = 800
End If
End Sub

Please let me know if you have any questions.

Thanks
-Binoy
-----Original Message-----
Hi Binoy,

I can tell you a couple of things for certain. The error is occurring inyour Application_Start Event handler. The resson refreshing the browsermakes the error go away is that the Application_Start method only fires whenthe Application starts, which would happen rarely, and certainly NOT after apage is refreshed. So, the intermittent part is that the Application_Startmethod is only fired intermittently.

The error message indicates that there is a reference to an object in thatmethod, an object which has not been instantiated in any way. If you postyour Application_Start code I can take a wild guess as to the line thatthrew the exception.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Binoy" <an*******@discussions.microsoft.com> wrote in messagenews:b6****************************@phx.gbl...
Kevin,

We are working on Visual Studio .NET 2003 / Framework 1.1 on Windows XP desktops.

Server is Windows 2000 server with Framework 1.1.

I searched Google and came across with only questions -
No answers.

Thanks
-Binoy
>-----Original Message-----
>Well, the number of lines in your Application+Start

method should be even
>smaller. What development environment are you using?
>
>--
>HTH,
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>
>"bINOY" <an*******@discussions.microsoft.com> wrote in

message
>news:a1****************************@phx.gbl...
>> Kevin,
>>
>> Really Global.asax.vb has only 142 lines.
>>
>> Thanks
>> -Binoy
>>
>> >-----Original Message-----
>> >I would start by looking
>> at "Admin.Global.Application_Start(Object sender,
>> >EventArgs e)" - Line 347
>> >
>> >Could you post that?
>> >
>> >--
>> >HTH,
>> >Kevin Spencer
>> >..Net Developer
>> >Microsoft MVP
>> >Big things are made up
>> >of lots of little things.
>> >
>> >"Binoy" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:a0****************************@phx.gbl...
>> >> Hello,
>> >>
>> >> I am getting this error once in a while from my web >> >> sites. When I will refresh web browser, it goes off
and
>> >> sites are working fine.
>> >>
>> >> Directory structures and file names are as below-
>> >>
>> >> C:\WWW - corporate site, C:\WWW\default.aspx is
the >> >> default page and this site works fine.
>> >> C:\Content\www is a virtual directory(/content) on the
>> >> site from where all ASPX files (other than
>> default.aspx)
>> >> are referenced. All other files in \WWW are ASP

pages.
>> So
>> >> \WWW has a \bin directory, which has all ASPX
Dlls. >> >>
>> >> C:\Content\div1.aspx
>> >> C:\Content\div2.aspx
>> >> C:\Content\div3.aspx
>> >> C:\Content\div4.aspx
>> >> ....... are our divisional site home pages [with
>> >> different divisional site IPs]. \content is also a >> virtul
>> >> directory (\content\www) for all divisional

sites, so
>> we
>> >> have bin directory copied in \content and

\content\www
>> as
>> >> well.
>> >>
>> >> Error description-
>> >> [NullReferenceException: Object reference not set

to an
>> >> instance of an object.]
>> >> Admin.Global.Application_Start(Object sender,
>> >> EventArgs e) +347
>> >>
>> >> Anybody has any idea of what is happening?
>> >>
>> >> Thanks in advance - Binoy
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.