influxdb-client-csharp icon indicating copy to clipboard operation
influxdb-client-csharp copied to clipboard

Get rid of System.Drawing.Common dependency

Open 2mik opened this issue 2 years ago • 7 comments

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 avatar Aug 11 '22 07:08 2mik

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 avatar Aug 11 '22 07:08 2mik

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

2mik avatar Aug 11 '22 11:08 2mik

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 avatar Aug 11 '22 12:08 2mik

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

2mik avatar Aug 11 '22 13:08 2mik

Hi @2mik,

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

Regards

bednar avatar Aug 12 '22 05:08 bednar

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.

2mik avatar Aug 12 '22 06:08 2mik

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.

adambajguz avatar Jan 11 '23 19:01 adambajguz