开发者

Keep getting "Object reference not set to an instance of an object."

On our development environment system works fine but on Live system sometimes buttonClick action generates below error. If i press back 1-2 times it works without generating error.

On the live system error, it still shows my local path. Can this be the issue? Thanks for your help

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 stac开发者_如何学Gok trace below.

Stack Trace:

[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


To answer one question: when compiling .NET code into DLL, the local path of the source files is being stored in the assembly - not sure if only when compiling in Debug or also in Release.

Anyway, add the generated .PDB file to the same folder containing the DLL file on the server and you'll also get line number (instead of cryptic +3690): having this you can identify the exact line causing this error.. post this information here and we'll be able to help.


It seems you might have the page life cycle wrong and you might be setting a variable at a certain point and expecting that variable not to be null when you are accessing it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜