无法加载文件或程序集“log4net,版本=1.2.10.0,文化=中性,PublicKeyToken=692fbea5

13

本文介绍了无法加载文件或程序集“log4net,版本=1.2.10.0,文化=中性,PublicKeyToken=692fbea5521e1304"或其依赖项之一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

自过去 2 天以来,我在托管应用程序的服务器中收到此错误.我已经尝试过这里提到的大部分场景.但没有得到任何东西.

I am getting this error since last 2 days in my Server where i had hosted application. I had already tried most of the scenario mentioned here. but not getting anything.

这是我的堆栈跟踪 -

Here is my stack trace -

[FileNotFoundException: 无法加载文件或程序集 'log4net,版本=1.2.10.0,文化=中性,PublicKeyToken=692fbea5521e1304' 或它的依赖项之一.系统找不到指定的文件.]
CrystalDecisions.Shared.SharedUtils..cctor() +0

[FileNotFoundException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.]
CrystalDecisions.Shared.SharedUtils..cctor() +0

[TypeInitializationException: 的类型初始化器CrystalDecisions.Shared.SharedUtils"抛出异常.]
CrystalDecisions.Shared.SharedUtils.get_CurrentControl() +18
CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture() +8
CrystalDecisions.CrystalReports.Engine.CREngineRes.GetString(字符串姓名)+11
CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()+143 CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +131

[TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception.]
CrystalDecisions.Shared.SharedUtils.get_CurrentControl() +18
CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture() +8
CrystalDecisions.CrystalReports.Engine.CREngineRes.GetString(String name) +11
CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime() +143 CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +131

[TypeInitializationException: 的类型初始化器'CrystalDecisions.CrystalReports.Engine.ReportDocument' 抛出了一个例外.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0
AdminReports..ctor() +25 ASP.reportviewer_aspx..ctor() +14
__ASP.FastObjectFactory_app_web_reportviewer_aspx_cdcab7d2.Create_ASP_reportviewer_aspx()+20 System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPathvirtualPath, Type requiredBaseType, HttpContext context, Boolean允许跨应用程序)+109
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext 上下文,String requestType, VirtualPath virtualPath, String physicalPath) +31System.Web.UI.PageHandlerFactory.GetHandler(HttpContext上下文,String requestType, String virtualPath, String path) +37
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+334 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

[TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0
AdminReports..ctor() +25 ASP.reportviewer_aspx..ctor() +14
__ASP.FastObjectFactory_app_web_reportviewer_aspx_cdcab7d2.Create_ASP_reportviewer_aspx() +20 System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +109
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31 System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +334 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

版本信息:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.1

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

已经将我的 IIS 配置为允许应用程序在 32 位上运行.

Already configured my IIS to allow applications to run on 32bit.

推荐答案

我遇到了这个问题,为我解决的问题是转到程序属性(在项目 ->程序名称"属性下),然后在发布区,找到Application Files,找到Log4net.dll.

I have had this issue, and what fixed it for me was going to the program properties (under Project -> "Program Name" Properties) and then under the publish area, find the Application Files, and find the Log4net.dll.

这对我来说设置为包含(自动)",但实际上并未将其包含在程序中.当我将其设置为包含"时,这为我解决了这个问题.

This was set to "Include(Auto)" for me, but that did not actually include it in the Program. when i set this to "Include" That fixed that issue for me.

这篇关于无法加载文件或程序集“log4net,版本=1.2.10.0,文化=中性,PublicKeyToken=692fbea5521e1304"或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

参数计数与调用不匹配?
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)...
2023-11-11 C#/.NET开发问题
26

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

没有 EndInvoke 的 C# 异步调用?
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)...
2023-11-11 C#/.NET开发问题
2

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14