Skip to content
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

librdkafka.redist runtime files aren't copied to OutputPath in .NET Core. #2213

Open
inikulshin opened this issue Apr 25, 2024 · 0 comments
Open

Comments

@inikulshin
Copy link

Description

librdkafka.redist runtime files aren't copied to OutputPath in .NET Core target frameworks.

How to reproduce

I have an SDK project with

  <PropertyGroup>
    <TargetFrameworks>net472;net6.0</TargetFrameworks>
    ...

    <PackageReference Include="Confluent.Kafka" Version="2.2.0" />
    ...

After I build this project with VS2022, librdkafka/* files are copied to OutputPath only for net472.

But the issue is actually originates in restore.
MyProj\obj\MyProj.csproj.nuget.g.props contains Import of librdkafka.redist.props only for net472:

  <ImportGroup Condition=" '$(TargetFramework)' == 'net472' AND '$(ExcludeRestorePackageImports)' != 'true' ">
    <Import Project="$(NuGetPackageRoot)\librdkafka.redist\2.2.0\build\librdkafka.redist.props" Condition="Exists('$(NuGetPackageRoot)\librdkafka.redist\2.2.0\build\librdkafka.redist.props')" />
    ...
  </ImportGroup>
  <ImportGroup Condition=" '$(TargetFramework)' == 'net6.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
    ...
  </ImportGroup>

Workround

Explicitly reference librdkafka.redist in project file:

    <PackageReference Include="librdkafka.redist" Version="2.2.0" />

However, I'll appreciate an explanation of this behavior. Probably, it's not related to Kafka, but to .NET Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant