Symptom
- Error when building a project or solution in Visual Studio 2010.
- Error: Could not load file or assembly 'log4net' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Environment
- Visual Studio 2010
- Crystal Reports for Visual Studio 2010, RTM
Reproducing the Issue
- Set the Platform target for the class library or web application to Any CPU.
- Create a Web Deployment Project from your web application.
- Create a Web Setup Project and add the Web Deployment Project as your Project Output.
- Build the entire solution.
Cause
- The 64 bit version of log4net.dll is being copied into your web site or web application bin directory.
- The Visual Studio IDE is building the other project files as 32 bit and the 64 bit log4net causes the error to be thrown.
Resolution
- Copy the 32 bit version of log4net.dll to the directory below. A copy of log4net 32 bit is attached to this article.
- C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet
- Clean your solution and delete any copy of log4net.dll from the bin directory in your project.
- Build your solution.
Keywords
KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Bug Filed
Product
SAP Crystal Reports, developer version for Microsoft Visual Studio
Attachments
log4net32.zip |