0

I wonder how is it possible to integrate the ConfluentKafka NuGet in a .net standard 2.1 proj?

In the description at nuget.org, it seems that it can run when projects' target framework is up to .net standard 2.0 / .net core 2.1. Practically I've seen it in use in examples online and also when I use Kafka event as a trigger to an Azure Function - which is possible only when the framework is .net core 3.1.

enter image description here

As I understand from this table, .net core 2.1 is still standard 2.0. enter image description here

enter image description here

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Itay Barber
  • 63
  • 2
  • 9
  • 1
    You're misinterpreting that information. The dependencies listed on nuget.org are not an indication of maximum support. It's minimum targeting. The fact that it says ".NET Standard 2.0" means that it can run against .NET Standard 2.0, which is implemented by .NET Core 2.1 *and later*. – madreflection Jan 05 '22 at 20:02
  • Thanks for the fast answer. I changed my question since I think I didn't use the correct terminology. I basically wondered how this nuget can run in .net standard 2.1 if they're not mentioned there. As far as I know, core 2.1 is not the same as standard 2.1 – Itay Barber Jan 05 '22 at 20:14
  • 1
    Regardless of how you word it, you've still misinterpreted and misunderstood what you've read. Terminology isn't the issue. The package *requires* .NET Standard 2.0 as a minimum amount of functionality available to it. If you wanted to use it on .NET Core 1.1, for example, you couldn't because that runtime doesn't implement .NET Standard 2.0. But .NET Core 2.1 implements the .NET Standard 2.0 public API, so do .NET Core 3.0, 3.1, and now .NET 5 and 6 (which also implement .NET Standard 2.1), so a new project that targets a newer runtime can use a package that requires .NET Standard 2.0. – madreflection Jan 05 '22 at 20:20
  • Thanks a lot. Got it! – Itay Barber Jan 05 '22 at 20:25
  • 2
    @madreflection: Would it not make more sense for someone to summarize the comments into an answer (I'd up-vote it) and leave the question hanging around for the next person who has a similar misunderstanding. Yes, the OP had a misunderstanding and it was cleaned-up entirely by these comments. But, the purpose of this site is to provide a source for answers, not to answer individual questions. – Flydog57 Jan 05 '22 at 20:33
  • 1
    I think it should be clarified that the "Kafka Trigger" function doesn't depend on _your function_ having Confluent libraries. This is a generic event trigger than _happens_ to come from Kafka without exposing the Kafka client details – OneCricketeer Jan 05 '22 at 20:43
  • @Flydog57: You make an excellent point. I've withdrawn my close vote. – madreflection Jan 05 '22 at 20:44
  • That being said... Is there a specific error you're getting when installing or using the library in some standalone application? **not** an Azure function? – OneCricketeer Jan 05 '22 at 20:46

0 Answers0