Click here to Skip to main content
16,016,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am facing a problem after deploying an application on IIS but it is working fine on
local system. Can anyone please help me and resolve my error.

Below are details error message. : -

XML
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:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   Import..ctor() +331
   __ASP.FastObjectFactory_app_web_import_aspx_cdcab7d2_yh2j61kd.Create_ASP_import_aspx() +28
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +173
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +41
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +515
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +287

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
Posted
Updated 29-Jul-20 12:59pm
Comments
CHill60 5-Jan-15 6:20am    
Have you tried following the instructions to get more information?
Pradip R 5-Jan-15 6:27am    
This kind of error only occurs when you are getting null response and converting it to something. You are operating on that null data so you need to take a look at the response you are getting. I think you need to take a look at the start page on production server and check the server side code with debugging.
Rajesh chauhan (Bangalore) 5-Jan-15 7:40am    
Actually it's working fine on local system but when i am publishing this application it's also published successfully, after published i posting publish file on server (IIS)
then it's generating error with no exact line or location in perticular page only and rest of others are working fine.
Praveen Kumar Upadhyay 5-Jan-15 6:42am    
If you want to track the error. Then do record the error in Application_Error event of global.asax.
Rajesh chauhan (Bangalore) 5-Jan-15 7:40am    
Actually it's working fine on local system but when i am publishing this application it's also published successfully, after published i posting publish file on server (IIS)
then it's generating error with no exact line or location in perticular page only and rest of others are working fine.

1 solution

The error message is pretty explicit: it tells you exactly what you need to do in order to find out exactly what the problem is - turn on debugging so it can report the actaul information.

Until you do, we can't help in the slightest.
Even when you do, we can't help that much - "Object reference not set to an instance of an object" is a generic error which means that you tried to access a method, property, or field from a variable which contained a null value ( or Nothing in VB). Turning on debug will tell you exactly which line the error showed up on, but that probably isn't the line that cause the problem - you need to look at the code, work out which variable is null and then work back though your code to find out how it got to be null instead of containing an "genuine" instance of a class.
We can't do that for you: we can't run your code even if we had it, because it is likely to involve your data or your user input as well as the code.
 
Share this answer
 
Comments
Rajesh chauhan (Bangalore) 5-Jan-15 7:39am    
Actually it's working fine on local system but when i am publishing this application it's also published successfully, after published i posting publish file on server (IIS)
then it's generating error with no exact line or location in perticular page only and rest of others are working fine.
OriginalGriff 5-Jan-15 7:58am    
Then it's almost certainly connection or data related - all teh more reason to do what the error message told you!

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