简体   繁体   English

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

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

I get this error after installing Asp.NET Core Module to my Windows Server (2012 R2) machine, even though I didn't use Elmah module in my project .将 Asp.NET 核心模块安装到我的 Windows Server (2012 R2) 机器后,我收到此错误,即使我没有在我的项目中使用 Elmah 模块 I am publishing my Asp.NET Core 2.2 WebAPI over IIS (v8.5) by Visual Studio 2017. After getting the error, I installed elmah.corelibrary v1.2.2 (also tried with Elmah.Contrib.WebApi , Elmah.MVC ) and published again but it didn't help.我正在通过 Visual Studio 2017 通过 IIS (v8.5) 发布我的 Asp.NET Core 2.2 WebAPI。收到错误后,我安装了elmah.corelibrary v1.2.2 (也尝试使用Elmah.Contrib.WebApiElmah )并再次发布。但这没有帮助。

Couldn't figure out by looking to the stack trace that where is the source of exception.通过查看堆栈跟踪无法弄清楚异常的来源在哪里。 In any case, I attached the whole exception details:无论如何,我附上了整个异常细节:


Server Error in '/harmony-webapi' Application.

Could not load file or assembly 'Elmah' 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 'Elmah' 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 'Elmah' 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 'Elmah' 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) +59
   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 'Elmah' 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) +550
   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) +173
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1069
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +130
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

[HttpException (0x80004005): Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688

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

ELMAH doesn't work with ASP.NET Core. ELMAH 不适用于 ASP.NET 内核。 You are probably looking or ElmahCore for self-hosted logs or elmah.io for cloud-logging.您可能正在寻找自托管日志的ElmahCore或云日志记录的elmah.io

Alright, resolved.好的,解决了。 The problem was when I try to publish my WebAPI under "Default Web Site" or any other root web site on IIS, it throws Elmah exception because Elmah module was configured in the existing root web sites before. The problem was when I try to publish my WebAPI under "Default Web Site" or any other root web site on IIS, it throws Elmah exception because Elmah module was configured in the existing root web sites before. I tried to publish my app separately by creating a new web site on IIS and the exception is gone.我尝试通过在 IIS 上创建一个新的 web 站点来单独发布我的应用程序,并且异常消失了。

暂无
暂无

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

相关问题 “‘无法加载文件或程序集‘Elmah’或其依赖项之一。在 NuGet 中使用 Elmah.MVC 后,系统找不到指定的文件” - "'Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified'' after using Elmah.MVC in NuGet 无法加载文件或程序集的“扩展名”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Extensions' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ Ajax”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Ajax' or one of its dependencies. The system cannot find the file specified 具体:无法加载文件或程序集“xxxx”或其依赖项之一。 该系统找不到指定的文件 - A specific: Could not load file or assembly 'xxxx' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ XXX”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'XXX' 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 无法加载文件或程序集“路径”或其依赖项之一。 该系统找不到指定的文件 - 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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM