1

I am facing this error from two days but i am not getting correct answer. Can anyone please resolve my problem. I will be very glad for you if anyone fix my error and very very thanks in advance.

Actually my problem that if i am running this application in local system, it is running right but while i am deploying this then it gives below errors.

Below are my details errors message please check .

Server Error in '/iNew' 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: 


[No relevant source lines]

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\inew\1c90da5e\3add287c\App_Web_import.aspx.cdcab7d2.nayaw0tk.0.cs    Line: 0 

Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   Import..ctor() +229
   ASP.import_aspx..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\inew\1c90da5e\3add287c\App_Web_import.aspx.cdcab7d2.nayaw0tk.0.cs:0
   __ASP.FastObjectFactory_app_web_import_aspx_cdcab7d2_nayaw0tk.Create_ASP_import_aspx() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\inew\1c90da5e\3add287c\App_Web_import.aspx.cdcab7d2.nayaw0tk.1.cs:0
   System.Web.Compilation.BuildResultCompiledType.CreateInstance() +30
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +100
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +64
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +191
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +145
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
Bharadwaj
  • 2,535
  • 1
  • 22
  • 35
  • In line 229 of `Import.aspx.cs` (or 229 lines from the start of your constructor) you have an object reference which is `null`. See duplicate for debugging hints. – CodeCaster Jan 05 '15 at 10:46
  • 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. – Rajesh Chauhan Jan 05 '15 at 12:47
  • Almost all cases of `NullReferenceException` are the same. Please see "[What is a NullReferenceException in .NET?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net)" for some hints. – John Saunders Jan 05 '15 at 16:38
  • @HenkHolterman: I see `Import..ctor()`. How is that generated code? – John Saunders Jan 05 '15 at 16:45
  • @JohnSaunders - It's in the file `App_Web_import.aspx.cdcab7d2.nayaw0tk.0.cs` – H H Jan 05 '15 at 16:46
  • @HenkHolterman: I took that to be in the codebehind file - the constructor of the base class. – John Saunders Jan 05 '15 at 16:48
  • @HenkHolterman: the file is parsed from the .ASPX file. So it's not like this is completely "generated". The NRE is certainly from the code in the .ASPX file, and the linked article definitely applies. If the OP were to post the .ASPX file, we'd probably just be able to _look_ at it and find the problem. Similarly, if the OP were to begin simplifying the .ASPX file until there is no NRE, then the problem would be found very quickly. – John Saunders Jan 14 '15 at 02:32

0 Answers0