简体   繁体   中英

Page_Load not deploying only on server, even with “no instructions” on Page_Load

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.

  1. Open your dll on the web server from your web application folder with Telerik JustDecompile . It may surprise you to see that the code you think is there is not the same as the code that is actually there. There's a principle in debugging called "Stop thinking and look".

  2. Delete the cache of the web server C:\\WINDOWS\\Microsoft.NET\\Framework\\<version>\\Temporary ASP.NET Files . Look for 64 bit as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM