Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在IIS上部署(发布)并在本地计算机上运行时,对象引用未设置为对象的实例_C#_Asp.net - Fatal编程技术网

C# 在IIS上部署(发布)并在本地计算机上运行时,对象引用未设置为对象的实例

C# 在IIS上部署(发布)并在本地计算机上运行时,对象引用未设置为对象的实例,c#,asp.net,C#,Asp.net,两天来我一直面临这个错误,但我没有得到正确的答案。谁能解决这个问题 我的问题。如果有人纠正我的错误,我会为你感到非常高兴,并提前表示非常感谢 实际上,我的问题是,如果我在本地系统中运行这个应用程序,它运行正常,但是 我正在部署它,然后它会给出以下错误 下面是我的详细信息错误信息,请检查 Server Error in '/iNew' Application. Object reference not set to an instance of an object. Description:

两天来我一直面临这个错误,但我没有得到正确的答案。谁能解决这个问题 我的问题。如果有人纠正我的错误,我会为你感到非常高兴,并提前表示非常感谢

实际上,我的问题是,如果我在本地系统中运行这个应用程序,它运行正常,但是 我正在部署它,然后它会给出以下错误

下面是我的详细信息错误信息,请检查

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

在Import.aspx.cs的第229行(或构造函数开头的229行)中,您有一个对象引用,它是
null
。有关调试提示,请参阅“复制”。实际上,它在本地系统上运行良好,但当我发布此应用程序时,它也已成功发布,在发布后,我将发布文件发布到服务器(IIS)上然后,它只在特定页面中生成错误,没有精确的行或位置,其余的都正常工作。几乎所有的
NullReferenceException
情况都是一样的。有关提示,请参见“”。@HenkHolterman:我看到了
Import..ctor()
。生成的代码是如何生成的?@JohnSaunders-它位于文件
App\u Web\u import.aspx.cdcab7d2.nayaw0tk.0.cs