InfluxDB c# api

Hello,

I’m looking to interface my software in c# to the influxdb instance.

I try to install the plug-in InfluxDB.Client via nuget.

On install i’ve an error indicating “Can’t install package “InfluxDB.Client 1.10.0” You’re trying to install this package in a project targeting .NETFramework, Version=v4.6.1”. The package does not contain any file or assembly architecture compatible.

Which .NETFramework we have to use the package ?

Thank you.
Florent

Hi @Flow,

Based on https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support,
I suppose that you should upgrade the project to target .NET Framework 4.7.2 or higher.

Regards

Hello,

According to NuGet Gallery | InfluxDB.Client 1.10.0
It requires .NETStandard 2.0 which correspond to .NET Framework 4.6.1.

OK. Thanks.

Still problem :

Install-Package : Impossible d’installer le package «InfluxDB.Client 1.10.0». Vous essayez d’installer ce package dans un projet ciblant «
.NETFramework,Version=v4.7.2», mais le package ne contient aucun fichier de contenu ou référence d’assembly compatible avec cette infrastructure. Pour
plus d’informations, contactez le créateur du package.
Au caractère Ligne:1 : 1

  • Install-Package InfluxDB.Client -Version 1.10.0
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
      +

Same error with 4.8

Install-Package : Impossible d’installer le package «InfluxDB.Client 1.10.0». Vous essayez d’installer ce package dans un projet ciblant «.NETFramework,Version=v4.8», mais le package ne contient aucun fichier de contenu ou référence d’assembly compatible avec cette
infrastructure. Pour plus d’informations, contactez le créateur du package.
Au caractère Ligne:1 : 1

  • Install-Package InfluxDB.Client
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

You were right. According to Microsoft guidelines the 4.6.1 should be enough:

 The versions listed here represent the rules that NuGet uses to determine whether a given .NET   
 Standard library is applicable. While NuGet considers .NET Framework 4.6.1 as supporting .NET 
 Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were
 built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need 
 to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 
 or higher.

There is a similar problem caused by invalid NuGet cache: .net - Nuget package installation failure - Stack Overflow.

Could you try to delete a cache by: dotnet nuget locals all --clear?

Thanks.

Tried & Failed

I’ve prepared a simple Windows Form Apps that use InfluxDB.Client 1.10.0 and .NET Framework 4.6.1.

I am able to build app and use client to check InfluxDB status. Could you test it on your environment?

1 Like

Hello,

Thanks you very much for the sample.

mysteriously, I’ve could restore all the package from nuget including the Influxdb dll.

Thank.
Now I’ll see how it works. =)

Last question, your code, is also compatible with older InfluxDB version ?

----------------- my very bad, It works very good ! ---------------- I haven’t activate http endpoints.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.