diff --git a/build.sh b/build.sh
new file mode 100755
index 000000000..2f97f1ba0
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,14 @@
+for path in src/*/project.json; do
+ dirname="$(dirname "${path}")"
+ dnu restore ${dirname}
+ dnu build ${dirname} --framework dotnet5.4 --configuration Release --out .\artifacts\testbin;
+ dnu pack ${dirname} --framework dotnet5.4 --configuration Release --out .\artifacts\packages;
+done
+
+for path in test/*/project.json; do
+ dirname="$(dirname "${path}")"
+ dnu restore ${dirname}
+ dnu build ${dirname} --framework dotnet5.4 --configuration Release --out .\artifacts\testbin;
+ dnx -p ${dirname} test;
+done
+
diff --git a/src/Serilog/Context/ImmutableStack.cs b/src/Serilog/Context/ImmutableStack.cs
index ed67ab198..1e87d2a2c 100644
--- a/src/Serilog/Context/ImmutableStack.cs
+++ b/src/Serilog/Context/ImmutableStack.cs
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if LOGCONTEXT
using System;
using System.Collections.Generic;
#if REMOTING
@@ -81,5 +80,4 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
public T Top => _top;
}
-}
-#endif
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/src/Serilog/Context/LogContext.cs b/src/Serilog/Context/LogContext.cs
index d724c8edf..26fb50545 100644
--- a/src/Serilog/Context/LogContext.cs
+++ b/src/Serilog/Context/LogContext.cs
@@ -13,7 +13,6 @@
// limitations under the License.
-#if LOGCONTEXT
using System;
#if REMOTING
using System.Runtime.Remoting.Messaging;
@@ -260,6 +259,4 @@ sealed class Wrapper : MarshalByRefObject
}
#endif
}
-}
-
-#endif
+}
\ No newline at end of file
diff --git a/src/Serilog/Enrichers/LogContextEnricher.cs b/src/Serilog/Enrichers/LogContextEnricher.cs
index 1ecb82fc5..e2432d5af 100644
--- a/src/Serilog/Enrichers/LogContextEnricher.cs
+++ b/src/Serilog/Enrichers/LogContextEnricher.cs
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if LOGCONTEXT
using Serilog.Context;
using Serilog.Core;
using Serilog.Events;
@@ -27,4 +26,3 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
}
}
}
-#endif
diff --git a/src/Serilog/LoggerConfigurationExtensions.cs b/src/Serilog/LoggerConfigurationExtensions.cs
index 04d90b9ec..bca89df6c 100644
--- a/src/Serilog/LoggerConfigurationExtensions.cs
+++ b/src/Serilog/LoggerConfigurationExtensions.cs
@@ -40,7 +40,6 @@ namespace Serilog
public static class LoggerConfigurationExtensions
{
-#if LOGCONTEXT
///
/// Enrich log events with properties from .
///
@@ -53,7 +52,6 @@ public static LoggerConfiguration FromLogContext(
if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration));
return enrichmentConfiguration.With();
}
-#endif
///
/// Enrich log events with a ThreadId property containing the current .
diff --git a/src/Serilog/project.json b/src/Serilog/project.json
index 428d4f018..15e1f78b5 100644
--- a/src/Serilog/project.json
+++ b/src/Serilog/project.json
@@ -10,7 +10,7 @@
"net45": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
- "define": [ "APPSETTINGS", "LOGCONTEXT", "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "REMOTING" ]
+ "define": [ "APPSETTINGS", "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "REMOTING" ]
},
"frameworkAssemblies": {
"System.Configuration": ""
@@ -19,7 +19,7 @@
"dotnet5.1": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
- "define": [ "NO_APPDOMAIN", "LOGCONTEXT" ]
+ "define": [ "NO_APPDOMAIN" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
@@ -39,7 +39,7 @@
"dotnet5.4": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
- "define": [ "ASYNCLOCAL", "LOGCONTEXT", "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "NO_TIMER", "NO_APPDOMAIN", "USERNAMEFROMENV" ]
+ "define": [ "ASYNCLOCAL", "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "NO_TIMER", "NO_APPDOMAIN", "USERNAMEFROMENV" ]
},
"dependencies": {
diff --git a/test/Serilog.Tests/Context/LogContextTests.cs b/test/Serilog.Tests/Context/LogContextTests.cs
index a328a4fd9..980ad9535 100644
--- a/test/Serilog.Tests/Context/LogContextTests.cs
+++ b/test/Serilog.Tests/Context/LogContextTests.cs
@@ -1,6 +1,5 @@
using System;
using System.IO;
-#if LOGCONTEXT
using Xunit;
using Serilog.Context;
using Serilog.Events;
@@ -235,5 +234,4 @@ public bool IsCallable()
}
}
#endif
-}
-#endif
+}
\ No newline at end of file
diff --git a/test/Serilog.Tests/Settings/AppSettingsTests.cs b/test/Serilog.Tests/Settings/AppSettingsTests.cs
index be4b6a3cb..ed1aae1ab 100644
--- a/test/Serilog.Tests/Settings/AppSettingsTests.cs
+++ b/test/Serilog.Tests/Settings/AppSettingsTests.cs
@@ -149,7 +149,6 @@ public void ProcessIdEnricherIsApplied()
}
#endif
-#if LOGCONTEXT
[Fact]
public void LogContextEnricherIsApplied()
{
@@ -172,7 +171,6 @@ public void LogContextEnricherIsApplied()
Assert.NotNull(evt.Properties["A"].LiteralValue() as int?);
Assert.Equal(1, (int)evt.Properties["A"].LiteralValue());
}
-#endif
}
}
#endif
diff --git a/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs b/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs
index fae6d90bc..714376512 100644
--- a/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs
+++ b/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs
@@ -72,9 +72,7 @@ public void FindsEventEnrichersWithinAnAssembly()
.ToList();
-#if LOGCONTEXT
Assert.True(eventEnrichers.Contains("FromLogContext"));
-#endif
#if !DOTNET5_1
Assert.True(eventEnrichers.Contains("WithEnvironmentUserName"));
Assert.True(eventEnrichers.Contains("WithMachineName"));
diff --git a/test/Serilog.Tests/project.json b/test/Serilog.Tests/project.json
index c5a5fbfe9..540b93591 100644
--- a/test/Serilog.Tests/project.json
+++ b/test/Serilog.Tests/project.json
@@ -23,7 +23,7 @@
"dnx452": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
- "define": [ "APPSETTINGS", "LOGCONTEXT", "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "INTERNAL_TESTS", "REMOTING" ]
+ "define": [ "APPSETTINGS", "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "INTERNAL_TESTS", "REMOTING" ]
},
"frameworkAssemblies": {
"System.Configuration": ""
@@ -31,7 +31,7 @@
},
"dnxcore50": {
"compilationOptions": {
- "define": [ "ASYNCLOCAL", "LOGCONTEXT", "FILE_IO", "PERIODIC_BATCHING", "NO_APPDOMAIN" ]
+ "define": [ "ASYNCLOCAL", "FILE_IO", "PERIODIC_BATCHING", "NO_APPDOMAIN" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",