logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: log4net is throwing TargetInvocationException
Date Fri, 21 Oct 2011 09:56:57 GMT
On 2011-10-21, John Moreno wrote:

> On Mon, Oct 17, 2011 at 11:45 PM, Stefan Bodewig <bodewig@apache.org> wrote:
>> On 2011-10-18, John Moreno wrote:

>>> log4net 1.2.10 is throwing an exception when I try to create it.

>> This happens with the 1.2.10 codebase if you compile it as a .NET 4.0

> I was using the 1.2.10 codebase and .net 4.0, but I have switched over
> to the 1.2.11 version, and I am still getthing the same exception from
> the call to the XmlConfigurator.Configure.

Is this the official binary or did you compile it yourself?  If using
the official binary, make sure you have the .NET 4.0 one.  If you
compile it yourself, ensure you define the NET_4_0 compilation symbol.

One other thing to look out for is the GAC (you may still be using
1.2.10).

The exception occurs as the GetObjectData method of ISerializable needs
a SecurityCritical attribute attached to it now and this only happens if
the code is compiled for 4.0 - and knows that it is.

Stefan

Mime
View raw message