Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jay 1 post 21 karma points
    Oct 24, 2012 @ 03:42
    Jay
    0

    Object reference not set to an instance of an object.

    It works in Dev and soon as I publish Only one page dont' work

    using Visual studio 2008 and .net Framework 3.5 and IIS 7 4.0.

    Only error in browser is

     

    Object reference not set to an instance of an object.
    No Idea What to do next.
  • Greg Fyans 140 posts 342 karma points
    Oct 25, 2012 @ 10:11
    Greg Fyans
    0

    Hi Jay,

    Unfortunately it's almost impossible to diagnose your problem without some more details. That must be the most popular ASP.NET error message out there :)

    Are you getting this error on your local machine or a remote server?

    Can you enable debug mode to get the full stack trace?

    Are you using custom appSettings or connectionStrings, have they been carried over to the live environment?

    Do you have a URL you can show us?

    Greg.

  • Steve G 2 posts 22 karma points
    Oct 26, 2012 @ 17:35
    Steve G
    0

    The error basically means that you are using an object before you've created an instance of it. For example:

     

    MyObject foo;

    foo.Add(someInformation) // Error here because the object has been created but not instantiated

     

    for the above code to work, you'll need to instantiate:

     

    MyObject foo = new MyObject();

    foo.Add(someInformation) // No error now because you've created an instance of the object

     

    Basically, your object is null because either you've not created an instance of it or the instance is based on an incorrect configuration making it null, such as assigning something from a misconfigured connectionStrings or appSettings (as Greg suggests). If you could give us some more information, we can try and work out the more likely causes.

     

    Edit:  Maybe it's folder permissions?  See http://our.umbraco.org/forum/core/general/35627-Object-reference-not-set-to-an-instance-of-an-object

Please Sign in or register to post replies

Write your reply to:

Draft