duplicati / duplicati

Store securely encrypted backups in the cloud!
Other
10.85k stars 893 forks source link

Fix build warnings for platform specific items #5167

Open kenkendk opened 4 months ago

kenkendk commented 4 months ago

The codebase is using a custom platform detection in Duplicati.Library.Utility which can be updated to use the standard .NET OperatingSystem class.

Methods and classes that are OS specific should be marked with [SupportedOSPlatform("windows")] attributes, and any warnings related to calling operating system specific code should be fixed.

Jojo-1000 commented 3 months ago

There are 167 warnings about incorrect calls. Most of them can be resolved by using the attribute and correct platform check except for Captcha/CaptchaUtil: This will need to be reworked, because it uses System.Drawing, which needs GDI+ and is only supported on Windows.

If you can't use System.Drawing with your application, recommended alternatives include ImageSharp, SkiaSharp, Windows Imaging Components, and Microsoft.Maui.Graphics.

kenkendk commented 3 months ago

I have fixed the Captcha stuff as part of dropping HttpServer. I am using ImageSharp for now.