c# - 我在 IIS 中的站点中遇到错误,未找到 Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0

标签 c# asp.net asp.net-mvc iis

我已经开始在 IIS 中运行的两个(完全不同的)项目中遇到此错误:

Server Error in '/' Application.
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.ViewResultBase.ExecuteResult(ControllerContext context) +0
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   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.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.WrappedAsyncVoid`1.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.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +657
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146


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

如果我稍等片刻然后刷新页面几次,错误就会消失。我正在运行带有 Visual Studio 2015 的 Windows 10。正如我所说,这些项目完全不同,彼此之间没有任何关系。

最佳答案

真是一团糟。当我回到 4-5 个月前从事的项目时,同样的事情发生在我身上。

关于 application insights 的提示是我找到解决方案的原因,但卸载旧的 application insights 似乎并没有解决问题。

我通过在 Application Insights Status Monitor Preview 中安装解决了这个问题(我通过单击右侧的“从画廊安装应用程序”在 IIS 的 Web 平台安装程序中找到了它)。然后我运行它,我的 IIS 应用程序出现了。我点击了“配置”或任何使它的状态为“已启用”的东西。然后在 Application Instaights Status Monitor Preview 窗口的顶部,我看到一个东西说我正在运行 Microsoft Monitor Agent 或类似的东西,所以我点击那里的按钮,它告诉我重置 IIS。重置 IIS 后它起作用了。

关于c# - 我在 IIS 中的站点中遇到错误,未找到 Microsoft.EnterpriseManagement.OperationsManager.Apm.DataCollecting.Producers.Mvc.4.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32005122/

相关文章:

javascript - 将表单的 html 值保存到数据库时值为空

c# - 使方法异步后 HttpContext.Current.Session 为空

c# - 当我使用 ASP.NET MVC 5 在服务器上部署时出现 JSON 404 错误

c# - 静默地从c#执行批处理文件

C# 在 CategorizedAlphabetical 排序的 ProperyGrid 中选择第一行

javascript - ASP.net/Javascript : Automatically postback triggering and next control to have focus

c# - asp.net 中的日期范围循环,C#

c# - ASP.NET MVC 中的路由,在 URL 中显示用户名

c# - 如何从文件路径而不是内容加载 XNA 模型(例如 Model.FromStream 但它不存在)

c# - 在 C# 中将字节转换为 GB?