title: Serilog Eventlog issue
body: <p>I have asp.net core 2.0 project.
  I am using Serilog for logging.
  Here is my project file:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp2.0&lt;/TargetFramework&gt;
      &lt;UserSecretsId&gt;aspnet-IdentityServerWithAspNetIdentity-04C6939F-E672-4E56-B4A5-5F064EB67F23&lt;/UserSecretsId&gt;
      &lt;StartupObject&gt;&lt;/StartupObject&gt;
      &lt;RootNamespace&gt;Pci.Services.IdentityServer4.Core&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;Pci.Services.IdentityServer4.Core&lt;/AssemblyName&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Compile Remove="Services\DbClientStore.cs" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;None Remove="Certificates\EPTokenCert.pfx" /&gt;
      &lt;None Remove="Certificates\idsrv3test.pfx" /&gt;
      &lt;None Remove="Certificates\SomeCert.pfx" /&gt;
      &lt;None Remove="ServiceConfig.yaml" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Content Include="Certificates\EPTokenCert.pfx" /&gt;
      &lt;Content Include="Certificates\SomeCert.pfx" /&gt;
      &lt;Content Include="ServiceConfig.yaml"&gt;
        &lt;CopyToOutputDirectory&gt;Always&lt;/CopyToOutputDirectory&gt;
      &lt;/Content&gt;
    &lt;/ItemGroup&gt;
  
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="IdentityServer4.AspNetIdentity" Version="2.1.0" /&gt;
      &lt;PackageReference Include="IdentityServer4.EntityFramework" Version="2.1.1" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.0.1" /&gt;
      &lt;PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.1" PrivateAssets="All" /&gt;
      &lt;PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="2.0.0" /&gt;
      &lt;PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.2" PrivateAssets="All" /&gt;
      &lt;PackageReference Include="Pci.ConfigProvider" Version="2.0.0.13" /&gt;
      &lt;PackageReference Include="Serilog" Version="2.6.0" /&gt;
      &lt;PackageReference Include="Serilog.AspNetCore" Version="2.1.0" /&gt;
      &lt;PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.2" /&gt;
      &lt;PackageReference Include="Serilog.Enrichers.Process" Version="2.0.1" /&gt;
      &lt;PackageReference Include="Serilog.Enrichers.Thread" Version="3.0.0" /&gt;
      &lt;PackageReference Include="Serilog.Exceptions" Version="3.0.0" /&gt;
      &lt;PackageReference Include="Serilog.Formatting.Compact" Version="1.0.0" /&gt;
      &lt;PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" /&gt;
      &lt;PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" /&gt;
      &lt;PackageReference Include="Serilog.Sinks.EventLog" Version="3.0.47" /&gt;
      &lt;PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /&gt;
      &lt;PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.1.1" /&gt;
      &lt;PackageReference Include="Smi.Encryption" Version="1.0.0" /&gt;
      &lt;PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.1" /&gt;
      &lt;PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.5" /&gt;
      &lt;PackageReference Include="System.IO" Version="4.3.0" /&gt;
      &lt;PackageReference Include="System.Security.Permissions" Version="4.4.1" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /&gt;
      &lt;DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" /&gt;
      &lt;DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;EmbeddedResource Include="Certificates\idsrv3test.pfx" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;ProjectReference Include="..\IdentityServer.Models\IdentityServer.Models.csproj" /&gt;
      &lt;ProjectReference Include="..\IdentityServer4.Services\Pci.Services.IdentityServer4.Services.csproj" /&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;Reference Include="System"&gt;
        &lt;HintPath&gt;..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>C# logic</p>
  
  <pre><code>Log.Logger = new LoggerConfiguration()
               .MinimumLevel.ControlledBy(_loggingLevelSwitch)
              //.MinimumLevel.Debug()
              //.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
              //.MinimumLevel.Override("System", LogEventLevel.Warning)
              //.MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information)
              .Enrich.WithProperty("ApplicationName", _systemConfiguration.ApplicationFriendlyName)
               //.Enrich.FromLogContext()
               .Enrich.WithEnvironmentUserName()
                 .Enrich.WithExceptionDetails()
                 .Enrich.WithMachineName()
                 .Enrich.WithProcessId()
                 .Enrich.WithThreadId()
                 .WriteTo.ColoredConsole()
              //.WriteTo.File(@"PCI.identityserver4_log.txt")
              .WriteTo.EventLog(GetExecutingAssemblyName(), "Application", restrictedToMinimumLevel: _systemConfiguration.LoggingConfiguration.WindowsEventlogVerbosity)
              //.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Literate)
              .CreateLogger();
  </code></pre>
  
  <p>.WriteTo.EventLog() is throwing</p>
  
  <blockquote>
    <p>System.TypeLoadException: 'Could not load type
    'System.Diagnostics.EventLog' from assembly 'System, Version=4.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089'.'</p>
  </blockquote>
  
  <p>Nuget package Serilog.Sinks.EventLog(3.0.47) is showing following warning</p>
  
  <blockquote>
    <p>Package 'Serilog.Sinks.EventLog 3.0.47' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.</p>
  </blockquote>
  
  <p>Please help me in fixing this issue.</p>