PLEASE READ THIS FIRST Please avoid tagging my question as possible duplicate of "What is a NullReferenceException and how to fix it"; I've read all of that before on some older questions. The NullReferenceException is not the main topic here, I understand where do they come from. The main topic is why am I getting this exception only on the server and not on local. Having clarified this, please read below :)
I have a form that pops-up with a button's click. There are some common controls on it; so when I run it through my local environment (visual studio's asp server) it shows fine, and even on the Page_Load I have many instructions that load the form's fields with data from a DB (it's an edit form).
But when I run it on the remote server through IIS (from a web browser) Instead of the form displaying I get a NullReferenceException
.
So I started commenting instructions from my Page_Load, so I could discard possibilities, until I reached the point of having my whole Page_Load method commented, seriously the 100%, no instructions should execute here, but I'm still getting the NullReferenceException error, the stack trace looks like this:
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] SisProEmp.editar_necesidad.Page_Load(Object sender, EventArgs e) +1645 System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3177
"editar_necesidad" is the name of the form (the html page).
Note that this only happens when testing through the web-browser, and not on local environment. At first I thought it might have been the DateTime format of the server, but I've discarded that since, as I mentioned, the Page_Load is executing nothing right now, and I don't even get to see the rendered empty controls.