0
votes

When running IIS, I'm getting the below error on all ASPX pages. ASP.NET is registered for versions 2.0 (with 3.5 extension) and 4.0. I'm running 2.0. Is there some setting I'm missing? I'm not sure what information is needed to better facilitate some help, so let me know what you need and I'll post it up as an edit.

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

ERROR MESSAGE

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.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name) +784 System.Web.Security.WindowsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +117 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

2
does the code run correctly in debug? Normally i would say make sure that default.aspx (or whatever your launch page) is set in the documents list, but this seems more like a code issue. is there a connection from your iis server to the database and are the db drivers installed?Brian
This error indicates something is wrong with your code. We can't help you fix it unless we can see this code. If it happens on all pages, it may also be related to your web.config file.Joel Coehoorn
@JoelCoehoorn It's not a code related issue. It has to do with the framework or IIS I believe. The code is just some plain text "test".steventnorris
@Brian I'm not using any sort of database. Does IIS inheritly use a DB? I noticed a setting for that, but it was set by default so I assume that's fine.steventnorris
@steven - then check your web.config. The NulReference relates to trying to use a variable or property that is declared but with no object to back it up, and that means code of some kind.Joel Coehoorn

2 Answers

2
votes

Normally a NullReferenceException is fairly easy to debug in code by debugging, but that stack trace appears to begin in framework code, so it's not your code that's failing.

In all likelihood, there's a problem with the .NET installation on IIS. (The fact that it starts in ISAPIWorkerRequestInProc is the biggest clue, I think. That's where the code interacts with the worker process.) Try running:

aspnet_regiis.exe -i

(info here) to re-install the IIS components of the framework.

0
votes

I had the exactly problem when I deployed my applications and took a while to find out that the reason was the asp.net version running on the application pool.

After I changed to 4.0 it started working

I hope that works for you too