csalle01
asked on
ASP.NET MVC Works in Local Visual Studio Server NullReferenceException on IIS
I am developing a small asp.net mvc intranet application for our company. Right now the home page will get the Windows username from the windows logged on user and make a call to our active directory based on that username to get more detailed info about the user (email, ect.)
Everything works great on my local Visual Studio 2008 server. But when I deploy all the files to my IIS 6.0 server I get the following:
[NullReferenceException: Object reference not set to an instance of an object.]
STPIntranet.MvcApplication .Session_S tart() in C:\Documents and Settings\csallemi\My Documents\Visual Studio 2008\Projects\STPIntranet\ STPIntrane t\Global.a sax.cs:50
[TargetInvocationException : Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle ._InvokeMe thodFast(O bject target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle .InvokeMet hodFast(Ob ject target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +71
System.Reflection.RuntimeM ethodInfo. Invoke(Obj ect obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +350
System.Reflection.RuntimeM ethodInfo. Invoke(Obj ect obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.Util.ArglessEve ntHandlerP roxy.Callb ack(Object sender, EventArgs e) +42
System.Web.SessionState.Se ssionState Module.Rai seOnStart( EventArgs e) +8779824
System.Web.SessionState.Se ssionState Module.Com pleteAcqui reState() +237
System.Web.SessionState.Se ssionState Module.Beg inAcquireS tate(Objec t source, EventArgs e, AsyncCallback cb, Object extraData) +504
System.Web.AsyncEventExecu tionStep.S ystem.Web. HttpApplic ation.IExe cutionStep .Execute() +66
System.Web.HttpApplication .ExecuteSt ep(IExecut ionStep step, Boolean& completedSynchronously) +155
It is failed in my Global.asax.cs file where I try to populate a custom User object (has a username and email property). In line 50 where the error is occuring I make a call to a class called SecurityUtil to get the theusername from WindowsIdentity.GetCurrent (); and get the email by making a call into our active directory.
I almost want to say that the necessary libraries are not getting added in either my project dll or web.config file because of the null pointer.
Please help. I'm running out of ideas.
Everything works great on my local Visual Studio 2008 server. But when I deploy all the files to my IIS 6.0 server I get the following:
[NullReferenceException: Object reference not set to an instance of an object.]
STPIntranet.MvcApplication
[TargetInvocationException
System.RuntimeMethodHandle
System.RuntimeMethodHandle
System.Reflection.RuntimeM
System.Reflection.RuntimeM
System.Web.Util.ArglessEve
System.Web.SessionState.Se
System.Web.SessionState.Se
System.Web.SessionState.Se
System.Web.AsyncEventExecu
System.Web.HttpApplication
It is failed in my Global.asax.cs file where I try to populate a custom User object (has a username and email property). In line 50 where the error is occuring I make a call to a class called SecurityUtil to get the theusername from WindowsIdentity.GetCurrent
I almost want to say that the necessary libraries are not getting added in either my project dll or web.config file because of the null pointer.
Please help. I'm running out of ideas.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
C:\Documents and Settings\csallemi\My Documents\Visual Studio 2008\Projects\STPIntranet\