title: Invalid cast from 'System.String' to 'Serilog.Core.IDestructuringPolicy'
body: <p>From studying <a href="https://github.com/serilog/serilog-sinks-azuretablestorage/tree/master" rel="noreferrer">Serilog.Sinks.AzureTableStorage</a> I have the following</p>
  <p>In Main</p>
  <pre><code> var configuration = new ConfigurationBuilder()
              .AddJsonFile(&quot;appsettings.json&quot;)
              .Build();
  
          var logger = new LoggerConfiguration()
              .ReadFrom.Configuration(configuration) // the error happens here
              .CreateLogger();
  
          logger.Information(&quot;Hello, world!&quot;);
  </code></pre>
  <p>In appsetttings.json  ( with different connection string)</p>
  <pre><code>&quot;Serilog&quot;: {
      &quot;Using&quot;: [ &quot;Serilog.Sinks.Console&quot;, &quot;Serilog.Sinks.AzureTableStorage&quot; ],
     
      &quot;MinimumLevel&quot;: &quot;Debug&quot;,
      &quot;WriteTo&quot;: [
        { &quot;Name&quot;: &quot;Console&quot; },
        {
          &quot;Name&quot;: &quot;File&quot;,
          &quot;Args&quot;: { &quot;path&quot;: &quot;%TEMP%\\Logs\\serilog-configuration-sample.txt&quot; }
        },
        {
          &quot;Name&quot;: &quot;AzureTableStorage&quot;,
          &quot;Args&quot;: {
            &quot;storageTableName&quot;: &quot;mystoragetable&quot;,
            &quot;connectionString&quot;: &quot;myconnectionstring&quot;
                  }
        }
      ],
      &quot;Enrich&quot;: [ &quot;FromLogContext&quot;, &quot;WithMachineName&quot;, &quot;WithThreadId&quot; ],
      &quot;Destructure&quot;: [
        {
          &quot;Name&quot;: &quot;With&quot;,
          &quot;Args&quot;: { &quot;policy&quot;: &quot;Sample.CustomPolicy, Sample&quot; }
        },
        {
          &quot;Name&quot;: &quot;ToMaximumDepth&quot;,
          &quot;Args&quot;: { &quot;maximumDestructuringDepth&quot;: 4 }
        },
        {
          &quot;Name&quot;: &quot;ToMaximumStringLength&quot;,
          &quot;Args&quot;: { &quot;maximumStringLength&quot;: 100 }
        },
        {
          &quot;Name&quot;: &quot;ToMaximumCollectionCount&quot;,
          &quot;Args&quot;: { &quot;maximumCollectionCount&quot;: 10 }
        }
      ],
      &quot;Properties&quot;: {
        &quot;Application&quot;: &quot;Sample&quot;
      }    
    }
  </code></pre>
  <p>I see in the debug output yet no data gets logged to the storage table.</p>
  <blockquote>
  <p>Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll</p>
  <p>An unhandled exception of type 'System.InvalidCastException' occurred in System.Private.CoreLib.dll</p>
  <p>Invalid cast from 'System.String' to 'Serilog.Core.IDestructuringPolicy'.</p>
  </blockquote>
  <p>[Update]</p>
  <p>If I use a very simple config as per the ReadMe.Md in GitHub, I get the same error.</p>
  <p>[Update]</p>
  <p>I copied in the code from Kennyzx link. The error has changed to</p>
  <pre><code>System.InvalidCastException
    HResult=0x80004002
    Message=Invalid cast from 'System.String' to 'Serilog.Core.ILogEventFilter'.
    Source=System.Private.CoreLib
     
  </code></pre>
  <p>I decided to try upgrading the serilog-settings-configuration sample project to .netcore2.1  and thus asked <a href="https://stackoverflow.com/questions/53126146/change-target-framework-from-net46netcoreapp2-1">this question</a></p>
  <p>After a few hours I came to the conclusion that serilog-settings-configuration s is not compatible with dotnetcore 2.1</p>