Open inikulshin opened 5 months ago
librdkafka.redist runtime files aren't copied to OutputPath in .NET Core target frameworks.
librdkafka.redist
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.
librdkafka/*
OutputPath
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:
MyProj\obj\MyProj.csproj.nuget.g.props
Import
librdkafka.redist.props
<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>
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.
Description
librdkafka.redist
runtime files aren't copied to OutputPath in .NET Core target frameworks.How to reproduce
I have an SDK project with
After I build this project with VS2022,
librdkafka/*
files are copied toOutputPath
only fornet472
.But the issue is actually originates in restore.
MyProj\obj\MyProj.csproj.nuget.g.props
containsImport
oflibrdkafka.redist.props
only fornet472
:Workround
Explicitly reference
librdkafka.redist
in project file:However, I'll appreciate an explanation of this behavior. Probably, it's not related to Kafka, but to .NET Core.