Friday, March 16, 2012

Object reference not set to an instance of an object.

Hi all,Very strange problem. Everything was working just fine and then suddenly whatever page i access the following error message:

Object reference not set to an instance of an object.

The error line is always the first line of the .cs file.

The stack trace is:

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.UI.Control.CreateControlCollection() +0
System.Web.UI.Control.get_Controls() +18
System.Web.UI.Control.AddParsedSubObject(Object obj) +29
System.Web.UI.Control.System.Web.UI.IParserAccessor.AddParsedSubObject(Object obj) +4
ASP.MyStatus_aspx.__BuildControlTree(Control __ctrl) in C:\Inetpub\wwwroot\Status\Status.aspx:1
ASP.MyStatus_aspx.FrameworkInitialize() in c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\status\0a48e995\ae7978a4\1rs0b7cc.0.cs:0
System.Web.UI.Page.ProcessRequest() +85
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87

I dont understand how all of a sudden this error could crop up. I was debugging the app rigorously. Could this be a reason/

How can i solve this. Im using 1.1 framework.

i tried to check if the other 1.1 framework projects are working. they too are showing the same error.

Please help

Thanks

Hi,

Try restarting your system.If the error persists give us some more hints about the code.


I dont think its related to my code coz i tried to access another app which was in 1.1 it too gave the same error wherein the line1 was the point of error which is same as the one im getting here. I tried to restart but still its not coming the same.

What else could be the error.

Thanks


Do you have .NET 2.0 installed in the system?

Yes .net 2.0 is installed. But my app is in 1.1 framework.

I simply dont understand how this could happen all of a sudden. i am able to build my application successfully.

Any solutions.

Thanks


Hi,

Usually, this kind of error occured when the object is null. Sometime object doesnt initialize. In such cases, this kind of error occured.

Please know us about ur code more, so we can help you out.

Regards,

Nirav Patel


Nitinkcv:

Yes .net 2.0 is installed. But my app is in 1.1 framework.

I simply dont understand how this could happen all of a sudden. i am able to build my application successfully.

Any solutions.

Thanks

Was it working fine previously when .NET 2.0 was also installed? Please check the virtual directory properties -> ASP.NET and see whether the correct .NET version is selected.


Hi all,

I dont know how it worked but running iisreset in the prompt has solved my issue.

Anyway thanks for all your help.

Regards,

Nitin

0 comments:

Post a Comment