question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Samples are broken out of the box

See original GitHub issue

I copied the Sample out of the box virtually verbatim, substituting netcoreapp3.1 for the multiple targets and a true package reference for the project reference. I got the following exception.

What am I missing here?

System.ArgumentException
  HResult=0x80070057
  Message=Configuration for Action<Serilog.Configuration.LoggerEnrichmentConfiguration> is not implemented.
  Source=Serilog.Settings.Configuration
  StackTrace:
   at Serilog.Settings.Configuration.ObjectArgumentValue.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, IList`1 configurationMethods, Object receiver)
   at Serilog.Settings.Configuration.ConfigurationReader.ApplyEnrichment(LoggerConfiguration loggerConfiguration)
   at Serilog.Settings.Configuration.ConfigurationReader.Configure(LoggerConfiguration loggerConfiguration)
   at Serilog.Configuration.LoggerSettingsConfiguration.Settings(ILoggerSettings settings)
   at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, String sectionName, DependencyContext dependencyContext)
   at Serilog.ConfigurationLoggerConfigurationExtensions.Configuration(LoggerSettingsConfiguration settingConfiguration, IConfiguration configuration, DependencyContext dependencyContext)
   at Sample.Program.Main(String[] args) in \path\to\Sample\Program.cs:line 25

With the .csproj:

<Project Sdk="Microsoft.NET.Sdk">

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

    <ItemGroup>
        <PackageReference Include="Serilog.Sinks.Async" Version="1.4" />
        <PackageReference Include="Serilog.Settings.Configuration" Version="3.1" />
        <PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
        <PackageReference Include="Serilog.Sinks.File" Version="4.1" />
        <PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
        <PackageReference Include="Serilog.Enrichers.Process" Version="2.0.1" />
        <PackageReference Include="Serilog.Enrichers.Thread" Version="3.1" />
        <PackageReference Include="Serilog.Filters.Expressions" Version="2.1" />
        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.1" />
    </ItemGroup>

    <ItemGroup>
        <None Update="appsettings.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
    </ItemGroup>

</Project>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
skomis-mmcommented, Jun 28, 2020

Hi @mwpowellhtx ,

If you use v3.1 try get the sample from the master branch: https://github.com/serilog/serilog-settings-configuration/blob/master/sample/Sample/appsettings.json

The sample from the dev branch requires pre-release version of the package (3.2.0-dev-*)

0reactions
skomis-mmcommented, Jun 29, 2020

@mwpowellhtx It should be stable enough. Would be great if you try the dev releases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Got my Macy's Box with the sample size broken! Anyone ...
The one time I reached out to them (over one product issue in my box), they sent me a new one plus a...
Read more >
The end of broken sample containers? - Mark Brennan
We've received your samples but half of them are broken and we can't ... Take a look at the video demonstration of the...
Read more >
What to Do When You Have a Haemolysed Blood Sample
A haemolysed blood sample is when the red blood cells in the sample you provided have burst or broken down. This process is...
Read more >
Section 1.4: Other Effective Sampling Methods
In essence, we use cluster sampling when our population is already broken up into groups (clusters), and each cluster represents the population. That...
Read more >
A Complete Guide to Box Plots
Box plots are a streamlined way of summarizing the distribution of groups of data. Read this article to learn how to best use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found