sportradar / UnifiedOddsSdkNetCore

UnifiedFeed SDK is a client library that enables easier integration with the Betradar XML feeds. SDK exposes XML feed service interface in a more user-friendly way and isolates the client from having to do XML feed parsing, proper connection handling, error recovery, event queuing, data caching and dispatching.
https://sportradar.github.io/UnifiedOddsSdkNetCore/
Other
17 stars 14 forks source link

TypeInitializationException when solution refefrences RabbitMQ.Client v6 #17

Closed ibedek closed 10 months ago

ibedek commented 2 years ago

I've been upgrading our services to net6 (and all other nuget packages in shared projects), which caused feed service to fail to start with TypeInitializationException:

Unable to load one or more of the requested types.
Could not load type 'Sportradar.OddsFeed.SDK.API.Internal.ConfiguredConnectionFactory' from assembly 'Sportradar.OddsFeed.SDK, Version=1.26.0.0, Culture=neutral, PublicKeyToken=null' because the parent type is sealed.

With version 6 of RabbitMQ.Client, ConnectionFactory is changed to sealed (parent of ConfiguretdConnectionFactory), hence exception.

Steps to reproduce:

or overwrite "Sportradar.OddsFeed.SDK.DemoProject.csproj" with following content:

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

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net6.0</TargetFramework>
        <AssemblyVersion>1.25.0.7949</AssemblyVersion>
        <FileVersion>1.25.0.7949</FileVersion>
        <Version>1.0.0</Version>
    </PropertyGroup>

    <ItemGroup>
        <Compile Remove="Logs\**" />
        <EmbeddedResource Remove="Logs\**" />
        <None Remove="Logs\**" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
        <PackageReference Include="RabbitMQ.Client" Version="6.3.0" />
        <PackageReference Include="Sportradar.OddsFeed.SDKCore" Version="1.26.0" />
    </ItemGroup>

    <ItemGroup>
        <None Update="App.config">
            <CopyToOutputDirectory>Never</CopyToOutputDirectory>
        </None>
        <None Update="log4net.config">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
    </ItemGroup>

</Project>

EDIT: One of reasons for upgrade to net6 is end of support for netcore3.1 in few months. Additionally, RabbitMQ.Client in v6 has bunch of performance improvements (and we use it a lot internally on other parts of system)

JPThorne commented 1 year ago

@ibedek did you find a workaround for this?

hotyes commented 1 year ago

@dhrovat any plan to upgrade the RabbitMQ.Client ?

dhrovat commented 1 year ago

In the current version we dont upgrade dependent libraries because it would introduce breaking change to some existing customers. However we plan to release new major release in the beginning of next year, where also all dependent libraries will be updated to latest.

ikalafat commented 1 year ago

@dhrovat will this mentioned update include the https://github.com/sportradar/UnifiedOddsSdkNet (newer version of non-Core version of lib) as well? Thanks.

vedrantrebovic commented 11 months ago

In the current version we dont upgrade dependent libraries because it would introduce breaking change to some existing customers. However we plan to release new major release in the beginning of next year, where also all dependent libraries will be updated to latest.

Hello. When can we expect new release with updated dependencies? It's already September.

dhrovat commented 11 months ago

We are in the final stages of testing it internally. The prerelease version should be published next week.

dhrovat commented 10 months ago

Today the new major release was published. It includes the latest RabbitMq library (v6.5.0)