简体   繁体   English

无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 该系统找不到指定的文件

[英]Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. The system cannot find the file specified

I have two web applications under IIS 7 (local Windows 10 Pro).我在 IIS 7(本地 Windows 10 Pro)下有两个 Web 应用程序。 At the root is an MVC .Net Version 4.7.1.根是 MVC .Net 版本 4.7.1。 Everything seems to work fine here so far.到目前为止,这里似乎一切正常。 However, set up as a separate application under the default site root is an older .Net Version 4.0 WebForms application.但是,在默认站点根目录下设置为单独的应用程序是较旧的 .Net 版本 4.0 WebForms 应用程序。

The version 4 application is built in Visual Studio 2015 and the MVC is built using Visual Studio 2017. I have the version 4 WebForms app running under a different website with the same settings and it runs fine.第 4 版应用程序是在 Visual Studio 2015 中构建的,MVC 是使用 Visual Studio 2017 构建的。我有第 4 版 WebForms 应用程序在具有相同设置的不同网站下运行,并且运行良好。 It only has a problem when running under the root node as a different application.只有在根节点下作为不同的应用程序运行时才会出现问题。 Also I have tried using different App Pools on both application as well as using the same App Pool with no change in the error.此外,我尝试在两个应用程序上使用不同的应用程序池以及使用相同的应用程序池而错误没有变化。

I have also tried uninstalling ApplicationInsights and disabling it and I get the same issue.我也试过卸载 ApplicationInsights 并禁用它,但我遇到了同样的问题。

[FileNotFoundException: Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. [FileNotFoundException: 无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 The system cannot find the file specified.] System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +95 System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64 System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +60 System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +49系统找不到指定的文件。] System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, BooleanreflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, BooleanreflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +95 System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64 System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +60 System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode 节点, Boolean checkAptcaBit, Boolean ignoreCase) +49

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. [ConfigurationErrorsException: 无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 The system cannot find the file specified.] System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +558 System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +30 System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +182 System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1086 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +120 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, M系统找不到指定的文件。] System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +558 System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +30 System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +57 System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +182 System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1086 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +120 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, M ethodInfo[] handlers, IntPtr appContext, HttpContext context) +169 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +372 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329 ethodInfo[] handlers, IntPtr appContext, HttpContext context) +169 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +372 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. [HttpException (0x80004005): 无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 The system cannot find the file specified.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708系统找不到指定的文件。] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) + 708

In my case, sub app wasn't using ApplicationInsights and I added these exclusions to the sub app web.config file.就我而言,子应用程序没有使用 ApplicationInsights,我将这些排除项添加到子应用程序web.config文件中。 It fixed the problem.它解决了这个问题。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="false">
      <remove name="TelemetryCorrelationHttpModule" />
      <remove name="ApplicationInsightsWebTracking" />
    </modules> 
  </system.webServer>
</configuration>

Here is the discussing topic where I have found my answer https://github.com/aspnet/Microsoft.AspNet.TelemetryCorrelation/issues/21#issuecomment-508535397这是我找到答案的讨论主题https://github.com/aspnet/Microsoft.AspNet.TelemetryCorrelation/issues/21#issuecomment-508535397

My answer is a late answer but it might help someone else.我的答案是一个迟到的答案,但它可能会帮助其他人。

I also face the same issue when i am working with an application inside the default website in iis.当我在 iis 中的默认网站内使用应用程序时,我也面临同样的问题。 Please remove all .net files from root(in my case root is Default Web Site) then it will work.请从 root 中删除所有 .net 文件(在我的情况下,root 是默认网站)然后它就会工作。

您可以使用 NugetPackage Manager 并浏览Microsoft.AspNet.TelemetryCorrelation并安装它。

Stanley.斯坦利。

If i understand you correctly, i would recommend the following:如果我理解正确,我会推荐以下内容:

Navigate to the WebForms instance that works perfectly.导航到完美运行的 WebForms 实例。 In that directory do a search for files that contain the word 'Telemetry'.在该目录中搜索包含“遥测”一词的文件。 You should find a couple of .dll's.您应该找到几个 .dll。

Do the same search in the WebForms directory that does NOT work.在不起作用的 WebForms 目录中执行相同的搜索。 you should find noting or less files.你应该找到注意或更少的文件。

I would copy the 'Telemetry' files from the working instance to the broken instance(matching the directories) and see what happens.我会将“遥测”文件从工作实例复制到损坏的实例(与目录匹配),然后看看会发生什么。 !? !?

As per the error the code its trying to load missing files.根据错误,代码试图加载丢失的文件。 --could not load file or assembly.(FileNotFoundException) -- 无法加载文件或程序集。(FileNotFoundException)

So I found a SO Question that shows how to disable ApplicationInsights.所以我找到了一个SO Question ,它展示了如何禁用 ApplicationInsights。 Doing that did not actually fix the issue, but then I went in and removed all signs of it in Nuget packages and the config file at the root of my project.这样做并没有真正解决问题,但后来我进入并删除了 Nuget 包和项目根目录下的配置文件中的所有迹象。 Once I got that done the error no longer occurs.完成后,错误不再发生。

In my case I had to cleanup my applicationhost.config file for the sites in my .vs directory which I think was alluded to in other answers.在我的情况下,我必须为我的 .vs 目录中的站点清理我的 applicationhost.config 文件,我认为在其他答案中提到过。

I had a different root "/" path configured which seemed like it might have been the source of the conflict.我配置了一个不同的根“/”路径,这似乎是冲突的根源。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集“ Microsoft.Data.Service”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Microsoft.Data.Service' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“路径”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly "path" or one of its dependencies. The system cannot find the file specified XamlParseException:无法加载文件或程序集“ ResourceLibrary,...”或其依赖项之一。 该系统找不到指定的文件 - XamlParseException: Could not load file or assembly 'ResourceLibrary, …' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。该系统找不到指定的文件 - Could not load file or assembly or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Microsoft.AI.Web”或其依赖项之一。 系统找不到指定的文件 - Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。 该系统找不到指定的文件。 (不允许GAC) - Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed) 无法加载文件或程序集“ServiceStack”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Logging.SNLLoggingStandard3”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Logging.SNLLoggingStandard3' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Elmah”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集的“扩展名”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Extensions' or one of its dependencies. The system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM