going in to debug gives Object reference not set to an instance of an object.on page load

Last post 04-26-2007 11:30 AM by Hoonius. 3 replies.

Sort Posts:

  • going in to debug gives Object reference not set to an instance of an object.on page load

    04-26-2007, 9:00 AM
    • Member
      19 point Member
    • itsdanny
    • Member since 07-01-2005, 10:03 AM
    • UK
    • Posts 17

    Hi 99 times out of 100 when i go into debug i get the error below. to clear it i can use F5 once  to several times, the page  eventually loads. i suspect it's something to do with AJAX (as i never had this problem  before i  started creating ajax asp websites. The error normal means an error in my code so have i misssed something? has anyone else experienced this?

    thanks dan

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

    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.]
    System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods) +368
    System.Web.Script.Services.PageClientProxyGenerator.GetClientProxyScript(HttpContext context, IPage page, Boolean debug) +45
    System.Web.UI.ScriptManager.RegisterServices() +728
    System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +244
    System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +2012724
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1566


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

    DYOR
  • Re: going in to debug gives Object reference not set to an instance of an object.on page load

    04-26-2007, 11:08 AM
    • Participant
      831 point Participant
    • Hoonius
    • Member since 07-13-2006, 8:21 AM
    • England
    • Posts 195

    does this service collect anything from the web.config?  or maybe is's looking for some application wide object which hasn't been created yet?

     

    What code are you suing for for your web service? 

    Object reference not set to an instance of an object.

    can mean anything in all honesty.  Try adding a global.asax to your project, override the Application_Start event and step through the app load from there to find out what isn;t happening
     

  • Re: going in to debug gives Object reference not set to an instance of an object.on page load

    04-26-2007, 11:19 AM
    • Member
      19 point Member
    • itsdanny
    • Member since 07-01-2005, 10:03 AM
    • UK
    • Posts 17

    hi, I have a couple of connection strings in my web.config, nothing unusual really. There are no events in the glabal.asax application_start event (some sessions in session_start though). The website is in VB.

    How would i override the application_start event? 

    thanks

    dan 

    DYOR
  • Re: going in to debug gives Object reference not set to an instance of an object.on page load

    04-26-2007, 11:30 AM
    • Participant
      831 point Participant
    • Hoonius
    • Member since 07-13-2006, 8:21 AM
    • England
    • Posts 195

    I made a VB website and added a global.asax and all my events were overidden by default, weird.  VB is a bit patchy tho lol, but I'm biased being a C# head through and through :¬)

     I got this from mine anyway, hope it helps. Add a breakpoint on the Dim strSomeTrimg line and you should be able to follow the app as it loads.

     

    Sub

    Application_Start(ByVal sender As Object, ByVal e As EventArgs)

    ' Code that runs on application startup

    Dim strSomeString = "Test"

    End Sub
Page 1 of 1 (4 items)