System.IO.FileNotFoundException: Could not load file or assembly 'log4net.dll' when Symantec Protection for Sharepoint Servers is installed.
Last Updated May 26, 2019
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.
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.
As a workaround to this issue we have created a tool that places log4net.dll version (22.214.171.124) that is compatible with .NET 4.0 and a log4net.dll version (126.96.36.199) that is comptible with .NET 2.0 inside of the GAC.
Download and extract InstallLog4netDllinGAC.zip to the SPSS server.
Navigate into <Extract Path>\Release and run (As administrator) "InstallDllinGAC.exe"
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: