gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-30 01:29:37 24 4
gpt4 key购买 nike

我在 IIS 7(本地 Windows 10 专业版)下有两个 Web 应用程序。根是 MVC .Net 版本 4.7.1。到目前为止,这里的一切似乎都运行良好。但是,在默认站点根目录下设置为单独的应用程序是较旧的 .Net 4.0 版 WebForms 应用程序。

第 4 版应用程序是在 Visual Studio 2015 中构建的,MVC 是使用 Visual Studio 2017 构建的。我让第 4 版 WebForms 应用程序在具有相同设置的不同网站下运行,并且运行良好。它只有在作为不同应用程序在根节点下运行时才会出现问题。我还尝试在两个应用程序上使用不同的应用程序池,以及使用相同的应用程序池,但错误没有发生变化。

我也尝试过卸载 ApplicationInsights 并禁用它,但我遇到了同样的问题。

[FileNotFoundException: Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. 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

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. 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, MethodInfo[] 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. 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

最佳答案

在我的例子中,子应用没有使用 ApplicationInsights,我将这些排除项添加到子应用 web.config 文件中。它解决了问题。

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

这是我找到答案的讨论主题 https://github.com/aspnet/Microsoft.AspNet.TelemetryCorrelation/issues/21#issuecomment-508535397

我的回答是一个迟到的答案,但它可能对其他人有帮助。

关于c# - 无法加载文件或程序集 'Microsoft.AspNet.TelemetryCorrelation' 或其依赖项之一。该系统找不到指定的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50949255/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com