ArieGato / serilog-sinks-rabbitmq

Serilog Sink for RabbitMq
Apache License 2.0
53 stars 51 forks source link

Multitarget for Microsoft.Extensions.ObjectPool #193

Closed sungam3r closed 4 months ago

ArieGato commented 4 months ago

@sungam3r Could you create an issue for this and include why this is necessary?

ArieGato commented 4 months ago

@sungam3r The build failed. Any idea why?

sungam3r commented 4 months ago

Could you create an issue for this and include why this is necessary?

This is general-purpose versioning strategy when using MS packages from .NET Core. It's more simple and consumer-friendly. Consumers always use version of MS package corresponding to consumers' TFM. We should not force consumers of net5/net6/net7 apps to use Microsoft.Extensions.ObjectPool v8.x . It really can break them.

The only think I'm not sure is

  <ItemGroup  Condition="'$(TargetFramework)' == 'netstandard2.0'">
    <PackageReference Include="Microsoft.Extensions.ObjectPool" Version="2.1.0" />
  </ItemGroup>

I chose the lowest not obsolete version with the most downloads.

sungam3r commented 4 months ago

Superseded by https://github.com/ArieGato/serilog-sinks-rabbitmq/pull/197.

sungam3r commented 4 months ago

The build failed. Any idea why?

Microsoft.Extensions.ObjectPool.DisposableObjectPool on NET Core and Microsoft.Extensions.ObjectPool.DefaultObjectPool on net48 (netstandard2.0)

I bumped package version to 2.2.0.

I chose the lowest not obsolete version with the most downloads.

😕 2.2.0 has more downloads indeed.

sungam3r commented 4 months ago

I was wrong, not 2.2.0 but 3.0.0 is required to align types.

By the way this is not necessarily to bump to 3.0.0. I can just modify test to not expect Dispose call on net48. Up to you.