Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

SharePoint & Log4net

$
0
0

Hi,

I really need help in integrating SharePoint with log4net ?, i followed many tutorials, but i have some problems that face me.
What i did:

1- Install log4net [1.2.11] by running ( Install-Package log4net ) command into package Manager Console. And it adds the reference for me in bin file.

2- Make a separte .xml file which holds log4net configuration and placed this file inC:\inetpub\wwwroot\wss\VirtualDirectories\MyPort.
3- Add this line ( [assembly: log4net.Config.XmlConfigurator(ConfigFile ="C:\\inetpub\\wwwroot\\wss\\VirtualDirectories\\MyPort\\LogConfig", Watch =true)] )  in my AssemblyInfo.cs file.

4- Add this line (<sectionname="log4net"type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />) in <configSections> in web.config file.

5- Add this line ( <SafeControl Assembly="log4net,  Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a" Namespace="Log4Net.VisualWebPart1" TypeName="*" Safe="True" /> ) in <SafeControls> section in web.config file.

then i get error < Could not load file or assembly 'log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies. The system cannot find the file specified.
>while trying to add this visual webpart into site collection.
When i try to put the log4net.dll in GAC, i get another error ( Error    102    Both "Log4Net.csproj" and "Log4Net" contain a file that deploys to the same Package location: Log4Net.dll ) when deploying the project.


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>