locked
Object reference not set to an instance of an object. RRS feed

  • Question

  • User-1130272705 posted

    I have written the code for excel file upload. The error which i am getting is

    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 stack trace below.


    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Master_UploadLvOPBal.btnUpload_Click(Object sender, EventArgs e) +3693
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +114
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +139
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +28
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2980

    It is working locally but when I published on IIS it's not working.

    I have added Ajax Control Tool kit (DLL) but still it's giving me the error.

    Wednesday, March 14, 2018 7:09 AM

All replies

  • User690216013 posted

    Master_UploadLvOPBal.btnUpload_Click(Object sender, EventArgs e) +3693

    Find its source code, or decompile the assembly.

    It is purely a coding issue and have nothing to do with IIS yet.

    Wednesday, March 14, 2018 10:59 PM
  • User-460007017 posted

    Hi ankitar3,

    It looks like the reference is not copied to the bin folder when you publish the project. So have you checked which reference dll is missing from your bin folder? Please try to set the reference to copy to local and republish again.

    Best Regards,

    Yuk Ding

    Thursday, March 15, 2018 6:23 AM
  • User-1130272705 posted

    I have checked the bin folder all the dll are present in published folder. The uploaded file get saved on specified path but after that further operation doesn't get performed. like i want to display the contents of file into grid. 

    Thursday, March 15, 2018 6:50 AM
  • User-460007017 posted

    Hi ankitar3,

    Did you install the IIS static content feature? Maybe the missing feature cause the failure of the applicaton.

    Best Regards,

    Yuk Ding

    Thursday, March 15, 2018 8:27 AM