You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Matthew O'Connell (JIRA)" <ji...@apache.org> on 2017/03/20 09:55:41 UTC

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

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

Matthew O'Connell commented on LOG4NET-398:
-------------------------------------------

I can confirm this is still an issue in log4net 2.0.7 under .net 4.6.2

{code}
System.Runtime.Serialization.SerializationException occurred
  HResult=-2146233076
  Message=Type is not resolved for member 'log4net.Util.PropertiesDictionary,log4net, Version=2.0.7.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
  Source=mscorlib
  StackTrace:
       at System.AppDomain.get_Evidence()
       at System.AppDomain.get_Evidence()
       at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
       at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
       at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
       at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
       at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at RazorEngine.Configuration.TemplateServiceConfiguration..ctor()
       at RazorEngine.Engine.get_Razor()
       at Foo.Providers.Mail.EmailFactoryBase`1.CreateMessage(T input, ISmtpMailConfig config, String htmlTemplateResource, Boolean includeTimeInSubject, IDictionary`2 attachments, IDictionary`2 images) in E:\dev\Foo\trunk-ro\Providers\Foo.Providers\Mail\EmailFactoryBase.cs:line 28
       at Foo.Providers.Mail.ProductAdjustmentEmailerBase.CreateMessageImpl(IEnumerable`1 notifyList) in E:\dev\Foo\trunk-ro\Providers\Foo.Providers\Mail\ProductAdjustmentEmailerBase.cs:line 55
       at Foo.Providers.Mail.ProductAdjustmentSpmoEmailer.<SendNotificationEmail>d__5.MoveNext() in E:\dev\Foo\trunk-ro\Providers\Foo.Providers\Mail\ProductAdjustmentSpmoEmailer.cs:line 43
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  InnerException: 
{code}

> 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.15#6346)