diff --git a/src/Serilog/Properties/InternalsVisibleTo.cs b/src/Serilog/Properties/InternalsVisibleTo.cs index 1b6bb1d75..dd34d0bdb 100644 --- a/src/Serilog/Properties/InternalsVisibleTo.cs +++ b/src/Serilog/Properties/InternalsVisibleTo.cs @@ -1,12 +1,11 @@ -using System.Runtime.CompilerServices; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyVersion("2.0.0.0")] -#if DOTNET5_4 || DOTNET5_1 -[assembly: InternalsVisibleTo("Serilog.Tests")] -#else [assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=" + "0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" + "6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" + "d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" + "94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" + "b19485ec")] -#endif \ No newline at end of file diff --git a/src/Serilog/project.json b/src/Serilog/project.json index 9d8698687..1b08f9f00 100644 --- a/src/Serilog/project.json +++ b/src/Serilog/project.json @@ -30,6 +30,7 @@ }, "dotnet5.1": { "compilationOptions": { + "keyFile": "../../assets/Serilog.snk", "define": [ "NO_APPDOMAIN" ] }, "dependencies": { @@ -48,6 +49,7 @@ }, "dotnet5.4": { "compilationOptions": { + "keyFile": "../../assets/Serilog.snk", "define": [ "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "NO_TIMER", "NO_APPDOMAIN" ] }, "dependencies": { diff --git a/test/Serilog.Tests/Core/MessageTemplateTests.cs b/test/Serilog.Tests/Core/MessageTemplateTests.cs index 804e4bc22..319c2b2fb 100644 --- a/test/Serilog.Tests/Core/MessageTemplateTests.cs +++ b/test/Serilog.Tests/Core/MessageTemplateTests.cs @@ -1,4 +1,6 @@ -using System; +#if INTERNAL_TESTS + +using System; using System.Globalization; using System.IO; using System.Linq; @@ -165,3 +167,5 @@ public void MissingPositionalParametersRenderAsTextLikeStandardFormats() } } } + +#endif diff --git a/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs b/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs index 02c4b90aa..97468175e 100644 --- a/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs +++ b/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs @@ -1,4 +1,6 @@ -using System; +#if INTERNAL_TESTS + +using System; using Xunit; using Serilog.Core.Sinks; using Serilog.Tests.Support; @@ -39,3 +41,5 @@ public void WhenASinkThrowsOtherSinksAreStillInvoked() } } } + +#endif diff --git a/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs b/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs index 8d5ee101f..3fad28e84 100644 --- a/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs +++ b/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if INTERNAL_TESTS + using System; using System.Globalization; using System.Linq; @@ -75,3 +77,5 @@ public void WhenDestructuringAKnownLiteralTypeIsScalar() } } } + +#endif diff --git a/test/Serilog.Tests/LogTests.cs b/test/Serilog.Tests/LogTests.cs index c2426f213..34a5a4d20 100644 --- a/test/Serilog.Tests/LogTests.cs +++ b/test/Serilog.Tests/LogTests.cs @@ -1,4 +1,6 @@ -using System; +#if INTERNAL_TESTS + +using System; using Xunit; using Serilog.Core.Pipeline; using Serilog.Tests.Support; @@ -45,3 +47,5 @@ private static IDisposable SwappedLogger(ILogger logger) } } } + +#endif diff --git a/test/Serilog.Tests/LoggerConfigurationTests.cs b/test/Serilog.Tests/LoggerConfigurationTests.cs index 094269bc4..70db9e909 100644 --- a/test/Serilog.Tests/LoggerConfigurationTests.cs +++ b/test/Serilog.Tests/LoggerConfigurationTests.cs @@ -59,6 +59,8 @@ public void DisposableSinksAreNotDisposedAlongWithContextualLoggers() Assert.False(sink.IsDisposed); } +#if INTERNAL_TESTS + [Fact] public void AFilterPreventsMatchedEventsFromPassingToTheSink() { @@ -78,7 +80,9 @@ public void AFilterPreventsMatchedEventsFromPassingToTheSink() Assert.True(events.Contains(included)); } -// ReSharper disable UnusedMember.Local, UnusedAutoPropertyAccessor.Local +#endif + + // ReSharper disable UnusedMember.Local, UnusedAutoPropertyAccessor.Local class AB { public int A { get; set; } diff --git a/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs b/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs index d567a2421..57a0d7a17 100644 --- a/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs +++ b/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs @@ -1,4 +1,6 @@ -using System; +#if INTERNAL_TESTS + +using System; using System.Collections.Generic; using System.Linq; using Xunit; @@ -234,3 +236,5 @@ public void ItemPropertiesNotAreIgnoredWhenDestructuring() } } } + +#endif diff --git a/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs b/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs index 9fd4a18eb..9bc8307ad 100644 --- a/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs +++ b/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs @@ -1,4 +1,4 @@ -#if PERIODIC_BATCHING +#if PERIODIC_BATCHING && INTERNAL_TESTS using System; using Xunit; using Serilog.Sinks.PeriodicBatching; diff --git a/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs b/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs index 939364a2f..38f054c14 100644 --- a/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs +++ b/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs @@ -1,4 +1,4 @@ -#if FILE_IO +#if FILE_IO && INTERNAL_TESTS using System; using System.Collections.Generic; diff --git a/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs b/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs index 48b53ce06..5e0332708 100644 --- a/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs +++ b/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs @@ -1,4 +1,6 @@ -using System; +#if INTERNAL_TESTS + +using System; using System.IO; using System.Linq; using Xunit; @@ -126,3 +128,5 @@ public void MatchingParsesDates() } } } + +#endif diff --git a/test/Serilog.Tests/project.json b/test/Serilog.Tests/project.json index a843dfe31..e3ec70b7e 100644 --- a/test/Serilog.Tests/project.json +++ b/test/Serilog.Tests/project.json @@ -16,7 +16,7 @@ "dnx451": { "compilationOptions": { "keyFile": "../../assets/Serilog.snk", - "define": [ "APPSETTINGS", "LOGCONTEXT", "FILE_IO", "PERIODIC_BATCHING" ] + "define": [ "APPSETTINGS", "LOGCONTEXT", "FILE_IO", "PERIODIC_BATCHING", "INTERNAL_TESTS" ] }, "frameworkAssemblies": { "System.Configuration": ""