Skip to content

Commit

Permalink
Merge pull request serilog#836 from nblumhardt/f-asynclocal4.6
Browse files Browse the repository at this point in the history
Use AsyncLocal rather than LogicalCallContext on .NET 4.6
  • Loading branch information
nblumhardt authored Aug 28, 2016
2 parents 356156e + 9a47ac0 commit 7560d2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/Serilog/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"define": [ "REMOTING" ]
}
},
"net4.6": {
"buildOptions": {
"define": [ "ASYNCLOCAL" ]
}
},
"netstandard1.0": {
"dependencies": {
"Microsoft.CSharp": "4.0.1",
Expand Down
6 changes: 4 additions & 2 deletions test/Serilog.Tests/Context/LogContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
using Serilog.Events;
using Serilog.Core.Enrichers;
using Serilog.Tests.Support;
#if REMOTING
#if APPDOMAIN
using System;
using System.IO;
#endif
#if REMOTING
using System.Runtime.Remoting.Messaging;
#endif
using System.Threading;
Expand Down Expand Up @@ -155,7 +157,7 @@ public void DoesNotPreventCrossDomainCalls()
#endif
}

#if REMOTING
#if REMOTING || APPDOMAIN
public class RemotelyCallable : MarshalByRefObject
{
public bool IsCallable()
Expand Down
5 changes: 5 additions & 0 deletions test/Serilog.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"define": [ "APPDOMAIN", "REMOTING", "GETCURRENTMETHOD" ]
}
},
"net4.6": {
"buildOptions": {
"define": [ "ASYNCLOCAL", "APPDOMAIN", "GETCURRENTMETHOD" ]
}
},
"netcoreapp1.0": {
"define": [ "ASYNCLOCAL" ],
"dependencies": {
Expand Down

0 comments on commit 7560d2b

Please sign in to comment.