influxdata / influxdb-client-csharp

InfluxDB 2.x C# Client
https://influxdata.github.io/influxdb-client-csharp/api/InfluxDB.Client.html
MIT License
358 stars 94 forks source link

Get rid of System.Drawing.Common dependency #346

Open 2mik opened 2 years ago

2mik commented 2 years ago

Proposal: It would be quite useful to get rid of System.Drawing.Common dependency.

Current behavior: My project uses the latest at the moment InfluxDB.Client 4.4.0. When I publish the project, the publish files contains runtimes\win\lib\net6.0\System.Drawing.Common.dll and runtimes\unix\lib\net6.0\System.Drawing.Common.dll System.Drawing is outdated and not managed library. Having it is weird, because the client doesn't work with any graphics.

Desired behavior: Have no System.Drawing in publish files.

Alternatives considered: no

Use case: For dotNet developers it's comfortable to use managed assemblies with low number of dependencies. The best situation when a client library has no dependencies except dotNet.

2mik commented 2 years ago

image I've got all the above dlls when publish. Why not reduce the amount to at least 10 dlls. For example, if I use CsvHelper.dll of another version in a big project, I got DLL hell.

2mik commented 2 years ago

image System.Drawing.Common comes with System.Configuration.ConfigurationManager

2mik commented 2 years ago

InfluxDB.Client.Core depends on CsvHelper and Newtonsoft.Json. Probably, there are no too complex CSV conversions, and it's possible not depend on CsvHelper. Modern .NET, starting from Core 3.0, contains classes to work with JSON, and Newtonsoft probably can be replaced by classes from the System.Text.Json namespace.

2mik commented 2 years ago

Just an example of MQTT client dependencies, which also actively works with network: image

bednar commented 2 years ago

Hi @2mik,

thanks for using our client. Is this something you might be willing to help with?

Regards

2mik commented 2 years ago

Hi, This issue affects the architecture of the client. That is why, I suppose, it should be implemented by the main author, I mean by you @bednar. If you decide to simplify the client dependencies, I'm ready to help with testing it on Windows and Linux. Also will be glad to take a part in discussions related to the issue.

adambajguz commented 1 year ago
InfluxDB.Client.Core depends on CsvHelper and Newtonsoft.Json.
Probably, there are no too complex CSV conversions, and it's possible not depend on CsvHelper.

Personally I'd rather have CSV parsing abstracted and available in InfluxDB.Client.CsvHelper. Same for Newtonsoft.Json since many people prefere to use e.g. System.Text.Json.

And finally I think that also NodaTime should be removed from main package. I'd prefer to install InfluxDB.Client.NodaTime.