mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
Fix to work with 7.0.4
This commit is contained in:
parent
c1c4286dee
commit
130d784319
|
|
@ -8,8 +8,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--Do NOT use version 7.0.3 or 7.0.4 because they have a bug that causes an exception.-->
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
|
||||
<!--The following packages are included anyway due to dependencies-->
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
Console.WriteLine("Warning! Versions 7.0.3xx and 7.0.4xx have bugs that cause an exception:");
|
||||
Console.WriteLine("Microsoft.Extensions.Configuration.Binder version: {0}",
|
||||
typeof(ConfigurationBinder).Assembly.GetCustomAttribute
|
||||
<AssemblyFileVersionAttribute>()?.Version);
|
||||
Console.WriteLine();
|
||||
|
||||
string logPath = Path.Combine(Environment.GetFolderPath(
|
||||
Environment.SpecialFolder.DesktopDirectory), "log.txt");
|
||||
|
||||
|
|
@ -52,6 +45,7 @@ configuration.GetSection("PacktSwitch").Bind(ts);
|
|||
|
||||
// Output the trace switch level from appsettings.json.
|
||||
Console.WriteLine($"Trace switch level: {ts.Level}");
|
||||
Console.WriteLine($"Trace switch value: {ts.Value}");
|
||||
|
||||
Trace.WriteLineIf(ts.TraceError, "Trace error");
|
||||
Trace.WriteLineIf(ts.TraceWarning, "Trace warning");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"PacktSwitch": {
|
||||
"Level": "Info"
|
||||
"Value": "Info", // Must be set to work with 7.0.3 or later.
|
||||
"Level": "Info" // To work with 7.0.2 or earlier including .NET 6.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,8 +8,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--Do NOT use version 7.0.3 or 7.0.4 because they have a bug that causes an exception.-->
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
|
||||
|
||||
<!--The following packages are included anyway due to dependencies-->
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
Console.WriteLine("Warning! Versions 7.0.3xx and 7.0.4xx have bugs that cause an exception:");
|
||||
Console.WriteLine("Microsoft.Extensions.Configuration.Binder version: {0}",
|
||||
typeof(ConfigurationBinder).Assembly.GetCustomAttribute
|
||||
<AssemblyFileVersionAttribute>()?.Version);
|
||||
Console.WriteLine();
|
||||
|
||||
string logPath = Path.Combine(Environment.GetFolderPath(
|
||||
Environment.SpecialFolder.DesktopDirectory), "log.txt");
|
||||
|
||||
|
|
@ -52,6 +45,7 @@ configuration.GetSection("PacktSwitch").Bind(ts);
|
|||
|
||||
// Output the trace switch level from appsettings.json.
|
||||
Console.WriteLine($"Trace switch level: {ts.Level}");
|
||||
Console.WriteLine($"Trace switch value: {ts.Value}");
|
||||
|
||||
Trace.WriteLineIf(ts.TraceError, "Trace error");
|
||||
Trace.WriteLineIf(ts.TraceWarning, "Trace warning");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"PacktSwitch": {
|
||||
"Level": "Info"
|
||||
"Value": "Info", // Must be set to work with 7.0.3 or later.
|
||||
"Level": "Info" // To work with 7.0.2 or earlier including .NET 6.
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue