无法加载文件或程序集“Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0

Could not load file or assembly 'Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0

我们是 运行 Windows Server 2008 R2 并升级到 2016,从那时起我们的应用程序已停止 运行。 ASP.NET Web 窗体仍在工作,只有 MVC 似乎已停止 运行。

他们都抛出 HTTP 503 错误,在修复 IIS URL 重写模块 2 后,他们开始抛出以下错误:

“/Mail”应用程序中的服务器错误。

Could not load file or assembly 'Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 
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. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

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.  

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.



WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Stack Trace: 



[FileNotFoundException: Could not load file or assembly 'Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +0
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +194
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +80
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +70

System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +18

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +444 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2106.0

我通过做两件事设法解决了问题:

  1. 修复IISURL重写模块

  2. 正在卸载包含 MVC 应用程序抱怨的程序集的 Microsoft Monitoring Agent。