Skip to content

Commit

Permalink
Removed .NET Core 3.1 and updated to .NET 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ckadluba committed Oct 17, 2022
1 parent a161ad1 commit b680ba7
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 157 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A Serilog sink that writes events to Microsoft SQL Server. This sink will write the log event data to a table and can optionally also store the properties inside an XML or JSON column so they can be queried. Important properties can also be written to their own separate columns.

**Package** - [Serilog.Sinks.MSSqlServer](http://nuget.org/packages/serilog.sinks.mssqlserver)
| **Minimum Platforms** - .NET Framework 4.6.2, .NET Core 3.1, .NET Standard 2.0
| **Minimum Platforms** - .NET Framework 4.6.2, .NET 6.0, .NET Standard 2.0

#### Topics

Expand Down Expand Up @@ -90,8 +90,8 @@ Because of the way external configuration has been implemented in various .NET f
| .NET Framework 4.6.2+ | `net462` | app or library | _System.Configuration_ |
| .NET Framework 4.6.2+ | `net462` | app or library | _Microsoft.Extensions.Configuration_ |
| .NET Standard 2.0 | `netstandard2.0` | library only | _Microsoft.Extensions.Configuration_ |
| .NET Core 3.1+ | `netcoreapp3.1` | app or library | _System.Configuration_ |
| .NET Core 3.1+ | `netcoreapp3.1` | app or library | _Microsoft.Extensions.Configuration_ |
| .NET 6.0+ | `net6.0` | app or library | _System.Configuration_ |
| .NET 6.0+ | `net6.0` | app or library | _Microsoft.Extensions.Configuration_ |

Although it's possible to use both XML and _M.E.C_ configuration with certain frameworks, this is not supported, unintended consequences are possible, and a warning will be emitted to `SelfLog`. If you actually require multiple configuration sources, the _M.E.C_ builder-pattern is designed to support this, and your syntax will be consistent across configuration sources.

Expand Down
50 changes: 1 addition & 49 deletions sample/AppConfigDemo/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section name="MSSqlServerSettingsSection" type="Serilog.Configuration.MSSqlServerConfigurationSection, Serilog.Sinks.MSSqlServer" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<MSSqlServerSettingsSection>

Expand All @@ -21,52 +21,4 @@
<TimeStamp ColumnName="TimeStampAlternative" ConvertToUtc="true" />

</MSSqlServerSettingsSection>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.4.0" newVersion="3.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Identity.Client" publicKeyToken="0a613f4dd989e8ae" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.45.0.0" newVersion="4.45.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Protocols.OpenIdConnect" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Protocols" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.JsonWebTokens" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.21.0.0" newVersion="6.21.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
34 changes: 6 additions & 28 deletions sample/AppConfigDemo/AppConfigDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7DC530B1-68FD-4F07-A2F9-910C338562C1}</ProjectGuid>
<ProjectGuid>{6BFE1D21-1442-4375-AB69-14160B906A64}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>AppConfigDemo</RootNamespace>
<AssemblyName>AppConfigDemo</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -35,37 +33,19 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=3.1.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.Configuration.Abstractions.3.1.4\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.2.9.0\lib\net46\Serilog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Common, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.Numerics" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.MSSqlServer\Serilog.Sinks.MSSqlServer.csproj">
Expand All @@ -76,12 +56,10 @@
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog">
<Version>2.5.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Data.SqlClient.SNI.1.1.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
</Target>
</Project>
20 changes: 0 additions & 20 deletions sample/AppConfigDemo/packages.config

This file was deleted.

2 changes: 1 addition & 1 deletion sample/CombinedConfigDemo/CombinedConfigDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion sample/WorkerServiceDemo/WorkerServiceDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>dotnet-WorkerServiceDemo-A4DFF8A6-AC69-443B-A3B8-34E284CD1C78</UserSecretsId>
</PropertyGroup>

Expand Down
22 changes: 11 additions & 11 deletions serilog-sinks-mssqlserver.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
# Visual Studio Version 17
VisualStudioVersion = 17.4.32916.344
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04226074-C72F-42BC-AB02-4D70A7BAE7E1}"
EndProject
Expand All @@ -15,8 +15,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{AA3463
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomLogEventFormatterDemo", "sample\CustomLogEventFormatterDemo\CustomLogEventFormatterDemo.csproj", "{873320F1-8F6D-45E2-A853-D321C86793EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppConfigDemo", "sample\AppConfigDemo\AppConfigDemo.csproj", "{7DC530B1-68FD-4F07-A2F9-910C338562C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkerServiceDemo", "sample\WorkerServiceDemo\WorkerServiceDemo.csproj", "{04F523D9-F00B-4C63-9287-31A244378E06}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CombinedConfigDemo", "sample\CombinedConfigDemo\CombinedConfigDemo.csproj", "{98F21125-AF7A-46E8-8C08-E3E4F5DBEDB9}"
Expand All @@ -30,12 +28,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetStandardDemoLib", "sample\NetStandardDemo\NetStandardDemoLib\NetStandardDemoLib.csproj", "{8E69E31B-61C7-4175-B886-9C2078FCA477}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetStandardDemoLib", "sample\NetStandardDemo\NetStandardDemoLib\NetStandardDemoLib.csproj", "{8E69E31B-61C7-4175-B886-9C2078FCA477}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetStandardDemoApp", "sample\NetStandardDemo\NetStandardDemoApp\NetStandardDemoApp.csproj", "{F908C46D-E72E-41E4-975D-73733294F93F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetStandardDemoApp", "sample\NetStandardDemo\NetStandardDemoApp\NetStandardDemoApp.csproj", "{F908C46D-E72E-41E4-975D-73733294F93F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NetStandardDemo", "NetStandardDemo", "{7B2B80DE-427A-4FEC-A7CE-7AD81FED73DE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppConfigDemo", "sample\AppConfigDemo\AppConfigDemo.csproj", "{6BFE1D21-1442-4375-AB69-14160B906A64}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -54,10 +54,6 @@ Global
{873320F1-8F6D-45E2-A853-D321C86793EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{873320F1-8F6D-45E2-A853-D321C86793EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{873320F1-8F6D-45E2-A853-D321C86793EC}.Release|Any CPU.Build.0 = Release|Any CPU
{7DC530B1-68FD-4F07-A2F9-910C338562C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DC530B1-68FD-4F07-A2F9-910C338562C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DC530B1-68FD-4F07-A2F9-910C338562C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DC530B1-68FD-4F07-A2F9-910C338562C1}.Release|Any CPU.Build.0 = Release|Any CPU
{04F523D9-F00B-4C63-9287-31A244378E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04F523D9-F00B-4C63-9287-31A244378E06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04F523D9-F00B-4C63-9287-31A244378E06}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -74,6 +70,10 @@ Global
{F908C46D-E72E-41E4-975D-73733294F93F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F908C46D-E72E-41E4-975D-73733294F93F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F908C46D-E72E-41E4-975D-73733294F93F}.Release|Any CPU.Build.0 = Release|Any CPU
{6BFE1D21-1442-4375-AB69-14160B906A64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BFE1D21-1442-4375-AB69-14160B906A64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BFE1D21-1442-4375-AB69-14160B906A64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BFE1D21-1442-4375-AB69-14160B906A64}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -82,12 +82,12 @@ Global
{803CD13A-D54B-4CEC-A55F-E22AE3D93B3C} = {04226074-C72F-42BC-AB02-4D70A7BAE7E1}
{3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {F02D6513-6F45-452E-85A0-41A872A2C1F8}
{873320F1-8F6D-45E2-A853-D321C86793EC} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{7DC530B1-68FD-4F07-A2F9-910C338562C1} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{04F523D9-F00B-4C63-9287-31A244378E06} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{98F21125-AF7A-46E8-8C08-E3E4F5DBEDB9} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{8E69E31B-61C7-4175-B886-9C2078FCA477} = {7B2B80DE-427A-4FEC-A7CE-7AD81FED73DE}
{F908C46D-E72E-41E4-975D-73733294F93F} = {7B2B80DE-427A-4FEC-A7CE-7AD81FED73DE}
{7B2B80DE-427A-4FEC-A7CE-7AD81FED73DE} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
{6BFE1D21-1442-4375-AB69-14160B906A64} = {AA346332-5BAF-47F1-B8FB-7600ED61265D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AAA6BF8D-7B53-4A5F-A79A-D1B306383B45}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using Serilog.Sinks.MSSqlServer.Configuration.Factories;

// The "Hybrid" configuration system supports both Microsoft.Extensions.Configuration and System.Configuration.
// This is necessary because .NET Framework 4.6.1+ and .NET Core 2.0+ apps support both approaches, whereas the
// This is necessary because .NET Framework 4.6.2+ and .NET Core 2.0+ apps support both approaches, whereas the

namespace Serilog
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private static void ReadMiscColumnOptions(IConfigurationSection config, ColumnOp
foreach (var standardCol in columnOptions.Store)
{
var stdColcolumnOptions = columnOptions.GetStandardColumnOptions(standardCol);
if (pkName.Equals(stdColcolumnOptions.ColumnName, StringComparison.InvariantCultureIgnoreCase))
if (pkName.Equals(stdColcolumnOptions.ColumnName, StringComparison.OrdinalIgnoreCase))
{
columnOptions.PrimaryKey = stdColcolumnOptions;
break;
Expand All @@ -173,7 +173,7 @@ private static void ReadMiscColumnOptions(IConfigurationSection config, ColumnOp
{
foreach (var col in columnOptions.AdditionalColumns)
{
if (pkName.Equals(col.ColumnName, StringComparison.InvariantCultureIgnoreCase))
if (pkName.Equals(col.ColumnName, StringComparison.OrdinalIgnoreCase))
{
columnOptions.PrimaryKey = col;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private static void ReadMiscColumnOptions(MSSqlServerConfigurationSection config
foreach (var standardCol in columnOptions.Store)
{
var stdColOpts = columnOptions.GetStandardColumnOptions(standardCol);
if (pkName.Equals(stdColOpts.ColumnName, StringComparison.InvariantCultureIgnoreCase))
if (pkName.Equals(stdColOpts.ColumnName, StringComparison.OrdinalIgnoreCase))
{
columnOptions.PrimaryKey = stdColOpts;
break;
Expand All @@ -149,7 +149,7 @@ private static void ReadMiscColumnOptions(MSSqlServerConfigurationSection config
{
foreach (var col in columnOptions.AdditionalColumns)
{
if (pkName.Equals(col.ColumnName, StringComparison.InvariantCultureIgnoreCase))
if (pkName.Equals(col.ColumnName, StringComparison.OrdinalIgnoreCase))
{
columnOptions.PrimaryKey = col;
break;
Expand Down
Loading

0 comments on commit b680ba7

Please sign in to comment.