search cancel

System.IO.FileNotFoundException: Could not load file or assembly 'log4net.dll' when Symantec Protection for Sharepoint Servers is installed.

book

Article ID: 174861

calendar_today

Updated On:

Products

Protection for SharePoint Servers

Issue/Introduction

 

When attempting to publish workflows using platform type as “SharePoint 2013 Workflow” the error:  “Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'log4net.dll” is generated.

Cause

 

During the installation of Symantec Protection for Sharepoint Server (SPSS) an independant copy of the log4.net into the installation directory.  This DLL is utilized by SPSS to perform logging functionality.  SPSS does not register the DLL into the system or into the GAC. 

Under some configurations Sharepoint Projects / Sites / Workflows can be configured to leverage log4net.dll for logging purposes.  In this circumstance Microsoft.NET will attempt to load the highest version of the dll present on the system.  If the Sharepoint implementation cannot access this resource the error can be thrown. 

Resolution

As a workaround to this issue we have created a tool that places log4net.dll version (2.0.8.0) that is compatible with .NET 4.0 and a log4net.dll version (1.2.10.0) that is comptible with .NET 2.0 inside of the GAC.

  1. Download and extract InstallLog4netDllinGAC.zip to the SPSS server.
  2. Navigate into <Extract Path>\Release and run (As administrator) "InstallDllinGAC.exe"
  3. Restart IIS from Run or Cmd.exe prompt (iisreset /restart)

To confirm the successful placement of the log4net.dll into the GAC you can run the following Microsoft Powershell commands:

gci C:\Windows\assembly\GAC_MSIL -Recurse | Where-Object {$_.name -like "*log4net.dll*"} | Select VersionInfo | fl

gci C:\Windows\Microsoft.NET\assembly\GAC_MSIL -Recurse | Where-Object {$_.name -like "*log4net.dll*"} | Select VersionInfo | fl

 

Attachments

InstallLog4netDllinGAC.zip get_app