markjprice/cs11dotnet7

Fix to the newer versions of Microsoft.Configuration.Extensions

leozaur1808 opened this issue · 1 comments

Previous workaround

Chapter: 4
Page Number: 181
Section Title: Reviewing project packages
Step Number: 3
Problem to fix: Exception has occurred:

CLR/System.Reflection.TargetInvocationException
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in System.Private.CoreLib.dll: 'Exception has been thrown by the target of an invocation.'
 Inner exceptions found, see $exception in variables window for more details.
 Innermost exception 	 System.ArgumentException : Must specify valid information for parsing in the string. Arg_ParamName_Name

Suggested solution: In appsettings.json change "Level" to "TraceLevel"
Other useful information e.g. OS, coding tools, and so on: VSCode, Mac OS, Dotnet version 7.0.100, Microsoft.Extensions.Configuration version 7.0.0, Microsoft.Extensions.Configuration.Binder version 7.0.4, Microsoft.Extensions.Configuration.FileExtensions version 7.0.0, Microsoft.Extensions.Configuration.Json version 7.0.0

Unfortunately, the TraceTrace.WriteLineIf(); does not work with this solution, despite the fact that Program.cs does not crash.