log4net configuration secuity exception

Topics: General
Jul 9, 2013 at 4:58 PM
Hello everyone and sorry for my english.
I have a problem to configuring the library log4net on my mvc4 project with (Framework 4.0) and with medium trust level.
The library version is "log4net-1.2.11".this library should be the version with the fix for the 4.0 framework.
When I start the application and runs the method log4net.Config.XmlConfigurator.Configure ();, I take an exception of type:

System.TypeLoadException: Safety rules of inheritance violated while overriding member: System.Runtime.Serialization.StreamingContext) '. The accessibility of safety override method must match the security accessibility of the method which you override.
in log4net.Repository.Hierarchy.Hierarchy .. ctor (ILoggerFactory loggerFactory) ......
you can help me solve this problem?
Coordinator
Jul 10, 2013 at 3:59 PM
You may be trying to run the application in partial trust aka medium trust. If you have the ability to run the website in full trust you should because log4net 1.2.11 no longer supports medium trust.

Adding this to the web.config will enable full trust.
<system.web>
    <trust level="Full" />
<system.web>