Open WeihanLi opened 1 year ago
Minimal sample to reproduce
// reference: nuget:WeihanLi.Common.Logging.Serilog
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using WeihanLi.Common.Logging.Serilog;
namespace BalabalaSample;
public class Issue06Sample
{
public static async Task MainTest()
{
var serviceCollection = new ServiceCollection()
.AddLogging(builder => builder.AddSerilog())
;
await using var provider = serviceCollection.BuildServiceProvider();
provider.GetRequiredService<ILoggerFactory>()
.CreateLogger("test")
.LogInformation("Hello 1234");;
}
}
Seemed it relates to the Microsoft.Extensions.Http
package reference, it works when removing the Microsoft.Extensions.Http
package reference, see commit https://github.com/WeihanLi/dotnet-exec/commit/a1dd0b5b39f882618e79def1591c7ce93fbca931
Created an issue on roslyn issues https://github.com/dotnet/sdk/issues/31691
Version: 0.14.0+60527bb786298d0a812968d5129b802c38bf12ef