'Serilog, .NET framework, IIS, and SQL Server

I am experiencing an issue with Serilog, IIS, SQL Server and .NET Framework. I have used Serilog with .NET 5 micro services and it works perfectly. The SQL Server permissions appear to be fine. I can locally run the .NET Framework solution and target SQL Server directly with the connection string.

I have added:

<section name="MSSqlServerSettingsSection" 
         type="Serilog.Configuration.MSSqlServerConfigurationSection, Serilog.Sinks.MSSqlServer"/> 

to the web.config. And further down in web.config, I have:

<MSSqlServerSettingsSection>

    <!-- SinkOptions parameters -->
    <BatchPostingLimit Value="150"/>
    <BatchPeriod Value="00:00:15"/>

    <!-- ColumnOptions parameters -->
    <AddStandardColumns>
        <add Name="LogEvent"/>
    </AddStandardColumns>
    <RemoveStandardColumns>
        <remove Name="MessageTemplate"/>
    </RemoveStandardColumns>
    <TimeStamp ConvertToUtc="true"/>
</MSSqlServerSettingsSection>

Any ideas what I could try?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source