Could not load file or assembly #39;log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304#39; or one of its dependencies(无法加载文件或程序集“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"或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法加载文件或程序集“log4net,版本=1.2.10.0,文化=中性,PublicKeyToken=692fbea5521e1304"或其依赖项之一
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- 使用 rss + c# 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01