-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readme.md docs don't work and throw InvalidCastException #194
Comments
Thanks for the note, we'll check it out |
CreepyGnome
changed the title
Readme.md docs don't work and throw FileLoadException
Readme.md docs don't work and throw InvalidCastException
Aug 15, 2019
This was fixed? How? I still get the same error, and the message is still the same.... |
@UltimateForm are you running the latest |
@nblumhardt no, just the nuget release, thought this fix had been released already, my bad 🙏 |
The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created a clean .NET Core console app. Followed the readme.md doc and Configuration extension method used has such
ReadFrom.Configuration(configuration)
throws System.InvalidCastException.System.InvalidCastException HResult=0x80004002 Message=Invalid cast from 'System.String' to 'Serilog.Core.IDestructuringPolicy'. Source=System.Private.CoreLib StackTrace: at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) at Serilog.Settings.Configuration.StringArgumentValue.ConvertTo(Type toType, ResolutionContext resolutionContext) at Serilog.Settings.Configuration.ConfigurationReader.<>c__DisplayClass18_2.<CallConfigurationMethods>b__3(<>f__AnonymousType9
2 <>h__TransparentIdentifier0)at System.Linq.Utilities.<>c__DisplayClass2_0
3.<CombineSelectors>b__0(TSource x) at System.Linq.Enumerable.SelectListPartitionIterator
2.ToList()at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at Serilog.Settings.Configuration.ConfigurationReader.CallConfigurationMethods(ILookup
2 methods, IList1 configurationMethods, Object receiver) at Serilog.Settings.Configuration.ConfigurationReader.Configure(LoggerConfiguration loggerConfiguration) at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings) at FunWithSerilogNetCore.Program.Main(String[] args) in C:\src\Playgroud\FunWithSerilogNetCore\Program.cs:line 15
If I remove the Destructure property from the appsettings.json it works.
See the attached project for example.
FunWithSerilogNetCore.zip
So if you could fix the readme.md so that the code will work maybe just remove the json property that it is failing on or better yet add what is missing so that it works with that json file.
The text was updated successfully, but these errors were encountered: