I've had some interesting times deploying a MVC3 app to a localhost IIS server but this one cuts the cake. I am getting a null reference exception when hitting the site from a browser. To be clear, this application works on Cassini, IIS Express and IIS 7 (Win2008) but doesn't work on IIS7.5 (Windows7).
The weird thing is, is that when I attach VS2010 to w3worker process the site WORKS! How weird is that. Once I close out of VS2010 it stops working.
Anyone have any suggestions?
Here is the error:
[NullReferenceException: Object reference not set to an instance of an
object.] NLog.LogManager.GetCurrentClassLogger() +84 DynamicInjector2efc601a855d4eb08717697546358942(Object[] ) +40 Ninject.Activation.Providers.StandardProvider.Create(IContext context) +335 Ninject.Activation.Context.Resolve() +177 Ninject.KernelBase.b_9(IContext context) +8 System.Linq.<>c_DisplayClass12
3.<CombineSelectors>b__11(TSource x) +32 System.Linq.WhereSelectEnumerableIterator
2.MoveNext() +151 System.Linq.d__b11.MoveNext() +92 System.Linq.Enumerable.Single(IEnumerable
1 source) +196 Ninject.ResolutionExtensions.Get(IResolutionRoot root, IParameter[] parameters) +151 Elvis.MvcApplication.get_Logger() +33 Elvis.MvcApplication.Application_Start() +126[HttpException (0x80004005): Object reference not set to an
instance of an object.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9028953 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +131 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253
[HttpException (0x80004005): Object reference not set to an
instance of an object.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644 System.Web.HttpRuntim开发者_JAVA百科e.EnsureFirstRequestInit(HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
I think that NLog cannot be run at medium trustlevel, so please confirm that you are running in a full trust environment. More information can be found here.
精彩评论