[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-12-17 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15061788#comment-15061788
 ] 

Lars Nellemann Nielsen commented on LOG4NET-398:


I know it fixes the exception, I've previously stated that I don't think it 
should be necessary to inherit MarshalByRefObject, read the comments again, I 
seems you misunderstood them

This fix might introduce regression failures, yeah the exception is gone, but 
doesn't mean this is the correct fix.

> SerializationException after setting a LogicalThreadContext property
> 
>
> Key: LOG4NET-398
> URL: https://issues.apache.org/jira/browse/LOG4NET-398
> Project: Log4net
>  Issue Type: Task
>  Components: Core
>Affects Versions: 1.2.12
> Environment: Visual Studio 2010
>Reporter: Thomas Meum
>Priority: Minor
>  Labels: triaged
> Attachments: log4net.zip
>
>
> I have found that accessing Page.Request.Url after setting a 
> LogicalThreadContext property causes a SerializationException with the 
> following message: Type is not resolved for member 
> 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
> Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
> I have been able to reproduce the problem on two different machines with the 
> following steps:
> 1. Create a new ASP.NET Empty Web Application
> 2. Add a reference to log4net.dll
> 3. Add a new Web Form
> 4. Add the following code to Page_Load:
> log4net.LogicalThreadContext.Properties["Test"] = 1;
> Uri url = Request.Url;
> 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-12-15 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15057792#comment-15057792
 ] 

Lars Nellemann Nielsen commented on LOG4NET-398:


I'm glad it's working out for you. 

I haven't planned making a pull request, because i think this issue needs more 
investigation. As it in my opinion really shouldn't be necessary to inherit 
MarshalByRefObject.

I'm by no means an expert on remoting and i really haven't got the time to 
properly read up on the subject.

>From the looks of the source history my best bet would be to ping [~bodewig] 
>for some input

> SerializationException after setting a LogicalThreadContext property
> 
>
> Key: LOG4NET-398
> URL: https://issues.apache.org/jira/browse/LOG4NET-398
> Project: Log4net
>  Issue Type: Task
>  Components: Core
>Affects Versions: 1.2.12
> Environment: Visual Studio 2010
>Reporter: Thomas Meum
>Priority: Minor
>  Labels: triaged
> Attachments: log4net.zip
>
>
> I have found that accessing Page.Request.Url after setting a 
> LogicalThreadContext property causes a SerializationException with the 
> following message: Type is not resolved for member 
> 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
> Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
> I have been able to reproduce the problem on two different machines with the 
> following steps:
> 1. Create a new ASP.NET Empty Web Application
> 2. Add a reference to log4net.dll
> 3. Add a new Web Form
> 4. Add the following code to Page_Load:
> log4net.LogicalThreadContext.Properties["Test"] = 1;
> Uri url = Request.Url;
> 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-08-13 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14694812#comment-14694812
 ] 

Lars Nellemann Nielsen commented on LOG4NET-398:


The project was built against 4.5.1 with/without optimizations

i've just tried to target it against 4.6 but same issue


 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged
 Attachments: log4net.zip


 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-29 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14605194#comment-14605194
 ] 

Lars Nellemann Nielsen commented on LOG4NET-398:


[~nachbarslumpi] Have you had a chance to test the attached solution ?

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged
 Attachments: log4net.zip


 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-24 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599053#comment-14599053
 ] 

Lars Nellemann Nielsen commented on LOG4NET-398:


We have run into the same problem and can replicate the issue on sites running 
in IIS and a console application acting as a host for multiple other console 
applications, separated in appDomains. So both rely on separate appDomains. 

The issue goes away when not setting log4net.LogicalThreadContext.Properties

LogicalThreadContext is implemented using 
System.Runtime.Remoting.Messaging.CallContex, and stores the data in 
log4net.Util.PropertiesDictionary which inherits 
log4net.Util.ReadOnlyPropertiesDictionary

making 
[log4net.Util.ReadOnlyPropertiesDictionary|http://svn.apache.org/viewvc/logging/log4net/trunk/src/log4net/Util/ReadOnlyPropertiesDictionary.cs?view=markup]
 inherit 
[MarshalByRefObject|https://msdn.microsoft.com/en-us/library/system.marshalbyrefobject%28v=vs.110%29.aspx]
 fixes the issue.

Its obvious that the properties dictionary cannot cross into the other 
appdomain, since inheriting MarshalByRefObject fixes it. I cannot see why 
installing log4net into the GAC fixes the problem as well, perhaps someone can 
shed some light on this?

Can anyone confirm the fix?

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged

 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-24 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599053#comment-14599053
 ] 

Lars Nellemann Nielsen edited comment on LOG4NET-398 at 6/24/15 8:13 AM:
-

We have run into the same problem and can replicate the issue on sites running 
in IIS and a console application acting as a host for multiple other console 
applications, separated in appDomains. So both rely on separate appDomains. 

The issue goes away when not setting log4net.LogicalThreadContext.Properties

LogicalThreadContext is implemented using 
System.Runtime.Remoting.Messaging.CallContext, and stores the data in 
log4net.Util.PropertiesDictionary which inherits 
log4net.Util.ReadOnlyPropertiesDictionary

making 
[log4net.Util.ReadOnlyPropertiesDictionary|http://svn.apache.org/viewvc/logging/log4net/trunk/src/log4net/Util/ReadOnlyPropertiesDictionary.cs?view=markup]
 inherit 
[MarshalByRefObject|https://msdn.microsoft.com/en-us/library/system.marshalbyrefobject%28v=vs.110%29.aspx]
 fixes the issue.

Its obvious that the properties dictionary cannot cross into the other 
appdomain, since inheriting MarshalByRefObject fixes it. I cannot see why 
installing log4net into the GAC fixes the problem as well, perhaps someone can 
shed some light on this?

Can anyone confirm the fix?


was (Author: nellemandela):
We have run into the same problem and can replicate the issue on sites running 
in IIS and a console application acting as a host for multiple other console 
applications, separated in appDomains. So both rely on separate appDomains. 

The issue goes away when not setting log4net.LogicalThreadContext.Properties

LogicalThreadContext is implemented using 
System.Runtime.Remoting.Messaging.CallContex, and stores the data in 
log4net.Util.PropertiesDictionary which inherits 
log4net.Util.ReadOnlyPropertiesDictionary

making 
[log4net.Util.ReadOnlyPropertiesDictionary|http://svn.apache.org/viewvc/logging/log4net/trunk/src/log4net/Util/ReadOnlyPropertiesDictionary.cs?view=markup]
 inherit 
[MarshalByRefObject|https://msdn.microsoft.com/en-us/library/system.marshalbyrefobject%28v=vs.110%29.aspx]
 fixes the issue.

Its obvious that the properties dictionary cannot cross into the other 
appdomain, since inheriting MarshalByRefObject fixes it. I cannot see why 
installing log4net into the GAC fixes the problem as well, perhaps someone can 
shed some light on this?

Can anyone confirm the fix?

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged

 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Issue Comment Deleted] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-24 Thread Lars Nellemann Nielsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Nellemann Nielsen updated LOG4NET-398:
---
Comment: was deleted

(was: Solution to reproduce)

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged
 Attachments: log4net.zip


 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-24 Thread Lars Nellemann Nielsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Nellemann Nielsen updated LOG4NET-398:
---
Attachment: log4net.zip

Solution to reproduce

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged
 Attachments: log4net.zip


 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-24 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599324#comment-14599324
 ] 

Lars Nellemann Nielsen commented on LOG4NET-398:


I'm not certain, frankly i'm a bit amazed that this is even an issue

Ive attached a simple project, so you can reproduce

the executing console application has no references to log4net, it doesn't even 
have any references to the other console applications as they are being loaded 
and executed with 
[AppDomain.ExecuteAssembly(String)|https://msdn.microsoft.com/en-us/library/sxx9f4c2%28v=vs.110%29.aspx]
 i.e only by their path

Placing log4net.dll in the root of the executing console application is just 
the same as placing it in GAC


 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged

 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property

2015-06-24 Thread Lars Nellemann Nielsen (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599324#comment-14599324
 ] 

Lars Nellemann Nielsen edited comment on LOG4NET-398 at 6/24/15 12:38 PM:
--

I'm not certain, frankly i'm a bit amazed that this is even an issue

Ive attached a simple project, so you can reproduce

the executing console application has no references to log4net, it doesn't even 
have any references to the other console applications as they are being loaded 
and executed with 
[AppDomain.ExecuteAssembly(String)|https://msdn.microsoft.com/en-us/library/sxx9f4c2%28v=vs.110%29.aspx]
 i.e only by their path

and as you can see in the solution, no logging is being done

Placing log4net.dll in the root of the executing console application is just 
the same as placing it in GAC



was (Author: nellemandela):
I'm not certain, frankly i'm a bit amazed that this is even an issue

Ive attached a simple project, so you can reproduce

the executing console application has no references to log4net, it doesn't even 
have any references to the other console applications as they are being loaded 
and executed with 
[AppDomain.ExecuteAssembly(String)|https://msdn.microsoft.com/en-us/library/sxx9f4c2%28v=vs.110%29.aspx]
 i.e only by their path

Placing log4net.dll in the root of the executing console application is just 
the same as placing it in GAC


 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Task
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum
Priority: Minor
  Labels: triaged
 Attachments: log4net.zip


 I have found that accessing Page.Request.Url after setting a 
 LogicalThreadContext property causes a SerializationException with the 
 following message: Type is not resolved for member 
 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, 
 Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
 I have been able to reproduce the problem on two different machines with the 
 following steps:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)