【问题标题】:NullReferenceException in IIS but not in VS 2015IIS 中的 NullReferenceException 但在 VS 2015 中没有
【发布时间】:2017-06-16 05:54:51
【问题描述】:

我一直在使用 Extjs 6 开发 MVC,当我在 Visual Studio 2015 上运行它时它运行良好,但是当我将它部署到 Windows 2012 R2 中的 IIS 8.5 时,我得到一个空引用异常。该错误会在登录后和页面尝试加载时立即发生。 信息: Microsoft .NET 框架版本:4.0.30319;版本 ASP.NET:4.6.1055.0 程序集=“System.Web.Mvc,版本=5.2.3.0 在 Windows 2012 R2 中 IIS:8.5

谢谢。

[NullReferenceException:Referencia a objeto no establecida como instancia de un objeto。] HiplotTM.Controllers.HomeController.Login(Usuarios objUsuario) +739 lambda_method(闭包,ControllerBase,对象[])+138 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +228 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 参数) +34 System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult,ActionInvocation innerInvokeState)+38 System.Web.Mvc.Async.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) +70 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +41 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +71 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +186 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +67 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +36 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +67 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137

【问题讨论】:

  • 根据我的观点,问题是,当项目部署在 IIS 中时,dataContext 没有实例化: HiplotTMdbConexion dataContext = new HiplotTMdbConexion。一些想法?谢谢。

标签: iis nullreferenceexception


【解决方案1】:

出于某种原因:

  1. 检查您的代码。
  2. 检查 Web.config 文件是否存在空引用异常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-02
    • 1970-01-01
    • 1970-01-01
    • 2019-06-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多