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” build warning of .net standard 2.0 project. #291

Closed
yang-xiaodong opened this Issue Aug 12, 2017 · 10 comments

Comments

Projects
None yet
7 participants
@yang-xiaodong

yang-xiaodong commented Aug 12, 2017

Build warning of .net standard 2.0 project.

Environment: Visual Studio 2017 Preview (15.3)

warning NU1701: Package 'librdkafka.redist 0.11.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

@mhowlett mhowlett added the bug label Aug 12, 2017

@mhowlett

This comment has been minimized.

Collaborator

mhowlett commented Aug 12, 2017

looks like we need to tweak something in the librdkafka.redist nuget package for the upcoming .net standard 2.0 @edenhill

@treziac

This comment has been minimized.

Contributor

treziac commented Aug 17, 2017

To explain what happens:

  • as librdkafka.redist has no target framework (normal, it's native, not managed), in .netstandard2.0, it assumes it loads it as a net461 and provide some warning. This is the case for all nuget which doesn't have a netstandard reference.
  • in our case, there is no managed dll, so it changes nothing (we just copy the runtimes folder). I just wonder if it could copy the x64/x86 in some cases where we don't need it (but it's already the case sometimes, it doesn' seem to be the case in my tests)

Except this, there is no downside at runtime. Adding NoWarn="NU1701" in the package reference in Confluent.Kafka remove the warnings (this is the way to go, see end of https://github.com/NuGet/Home/wiki/Improved-NuGet-warnings)

Edit: for current time, NoWarn should be added to librdkafka.redist which should be explicitly referenced to remove this warning actually, this is not transitive
(see https://github.com/NuGet/Home/wiki/%5BSpec%5D-Transitive-Warning-Properties)

@chlowell

This comment has been minimized.

chlowell commented Oct 10, 2017

@edenhill @treziac Another way to solve this without disabling the warning:

  1. Move librdkafka.redist.props to /build (adjusting paths in the file)
  2. Delete /build/net

In /build with no TFM, the props file will apply everywhere--which should be fine because it's already the same in all cases--and NuGet won't warn NU1701 in a .NET Core/Standard project.

@mbirnios

This comment has been minimized.

mbirnios commented Oct 20, 2017

Just curious to know if you were going to try @chlowell solution. We have this library inside another custom Nuget package in our company, which is then used in 20+ projects. So we get yellow warnings all over the place (and the NoWarn fix doesn't work because it's not transitive as you pointed out). Thx!

@mhowlett

This comment has been minimized.

Collaborator

mhowlett commented Oct 24, 2017

thanks @chlowell - i'll experiment with this now.

@TonyGerace

This comment has been minimized.

TonyGerace commented Nov 7, 2017

Also following up - we are in the same situation as @mbirnios.

@mhowlett

This comment has been minimized.

Collaborator

mhowlett commented Nov 7, 2017

@chlowell's suggestion is incorporated in #355, and should be in the release we're targeting for 20th Nov.

@TonyGerace

This comment has been minimized.

TonyGerace commented Nov 8, 2017

Great thanks @mhowlett!

@SuchimayaMohanty

This comment has been minimized.

SuchimayaMohanty commented Dec 4, 2017

@mhowlett Is the 20th Nov release changes are available to use?

@mhowlett

This comment has been minimized.

Collaborator

mhowlett commented Dec 4, 2017

@SuchimayaMohanty - just uploaded it to nuget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment