NetSparkleUpdater / NetSparkle

NetSparkle is a C# cross-platform software update framework for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 or DSA signatures! View basic usage here in the README or visit our website for code docs.
https://netsparkleupdater.github.io/NetSparkle/
MIT License
585 stars 81 forks source link

Problem inheriting from WebClientFileDownloader class and overriding CreateHttpClient method #575

Closed bdovaz closed 2 months ago

bdovaz commented 2 months ago

In the 2 constructors of this class a virtual method is invoked (PrepareToDownloadFile > CreateHttpClient) and this is not good practice and is causing me problems:

https://github.com/NetSparkleUpdater/NetSparkle/blob/225fb7be3fee10c262d6c8e3f312fc9cd71bba69/src/NetSparkle/Downloaders/WebClientFileDownloader.cs#L36

In sonar you can see why it should not be done and that it is just my exact problem:

https://rules.sonarsource.com/csharp/RSPEC-1699/?search=virtual

Deadpikle commented 2 months ago

Thanks for the heads up! Fixed in 420f961dfa9c9071332e2e0737b0f287d2cfa5dc and preview version rolling out now.