继续获取“对象引用未设置为对象的实例”。

时间:2010-11-08 10:49:32

标签: asp.net

在我们的开发环境系统上工作正常但在Live系统上有时buttonClick动作会产生以下错误。如果我按回1-2次,它可以正常工作而不会产生错误。

在实时系统错误中,它仍然显示我的本地路径。这可能是问题吗? 谢谢你的帮助

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.

异常详细信息:

System.NullReferenceException: Object reference not set to an instance of an object.

来源错误:

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.

堆栈追踪:

[NullReferenceException: Object reference not set to an instance of an object.] WebApplication4.orderConfirmation.SubmitButton_Click(Object sender, EventArgs e) in C:\Documents and Settings\Desktop\Purchase\WebApplication4\WebApplication4\orderConfirmation.aspx.cs:341 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +153 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3690

2 个答案:

答案 0 :(得分:1)

回答一个问题:在将.NET代码编译到DLL中时,源文件的本地路径存储在程序集中 - 不确定是仅在Debug中编译还是在Release中编译。

无论如何,将生成的.PDB文件添加到服务器上包含DLL文件的同一文件夹中,您还将获得行号(而不是神秘的+3690):有了这个,您可以识别导致此错误的确切行。在这里发布此信息,我们将能够提供帮助。

答案 1 :(得分:0)

看起来您的页面生命周期可能有问题,您可能会在某个位置设置变量,并且在访问该变量时期望该变量不为空。