Click here to Skip to main content
15,850,190 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello All,

I have developed a web application long time back which is working fine in Windows 2008 server.

now we need to move this application to new servers (new pre-prod and prod servers) and after putting necessary configuration in IIS, we have deployed the application on new pre-prod.

But we are getting below mentioned error -
Server Error in '/retailer/eosc' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
Rocs.Global_asax.subFormGetAdminSatList(String& sDlrSatList) in E:\Synergy\ROCS\ROCS_SourceCode\ROCS\Global.asax.vb:431
Rocs.Global_asax.Session_Start(Object sender, EventArgs e) in E:\Synergy\ROCS\ROCS_SourceCode\ROCS\Global.asax.vb:260
System.Web.SessionState.SessionStateModule.CompleteAcquireState() +408
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1295
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +114
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +374
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1016

Please note that the application is in .Net 4.0 and the databases are DB2 and SQL Server 2008

Also the same code is working fine on Dev and old Pre-prod server, not sure why I am getting this error.

Is there any IIS config setting which I am missing?

Please help me ASAP

Ankur Bakliwal
Updated 16-Oct-13 5:04am
Rajeev Jayaram 16-Oct-13 7:32am    

1 solution

An object is set to Nothing and you try to access its properties.

The error is on this file E:\Synergy\ROCS\ROCS_SourceCode\ROCS\Global.asax.vb:431
At the line 431.

On this line you got several dots for example
ObjectA.DoSomething(ObjectB.Property1.Name, ObjectC.Property2);

In this example the objects before the dots are:

If your code was 'ObjectA.DoSomething(ObjectB.Property1.Name, ObjectC.Property2);' In this example one of the item of these list would be null.
Share this answer
Ankur.Bakliwal 16-Oct-13 12:17pm    
There is no issue with the code.. as the same code is working fine in old server.
Pascal Ganaye 16-Oct-13 13:07pm    
What is the source of the line 431 in E:\Synergy\ROCS\ROCS_SourceCode\ROCS\Global.asax.vb
The system tells you the error occurs there.
It could well be that something within that line returns null only on the new server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900