Remora / Remora.Results

A simple, versatile algebraic data type for C#.
GNU Lesser General Public License v3.0
15 stars 5 forks source link

Add net461 target #9

Closed Foxtrek64 closed 4 months ago

Foxtrek64 commented 1 year ago

As it says on the tin.

Add a build target for net461, optionally other netfx versions as well. Other netfx versions after 461 should work with netstandard, but support for netstandard on netfx is buggy to put it lightly.

VelvetToroyashi commented 1 year ago

May I ask why this is being added? .NET 4.6.1 reached EOL a year ago and 4.6.2 is, well, .NET framework. Explicitly supporting netfx not only seems like it would hold us back in some regards (even with PolySharp), but also be extra maintenance for what no other discord library supports.

Foxtrek64 commented 1 year ago

I have a project on my own that re-implements Remora.Results as net461. I have a separate extensions library that contains my custom exception types. This extension library multi-targets net461 and net6 and has ifdefs to point to Tafs.Activities.Results or Remora.Results based on version.

DotNet really does not like this. Even if it does successfully build (I have to build per-project, not the whole solution), adding the nuget package to a net461 app throws exceptions that I need to reference various types from net6, even though multi-targeting and ifdefs should remove that as an issue.

I need to multi-target because the plan is to migrate to the net6 version of this app, but that change won't be able to happen until at least the new year, and it's causing roadblocks. Having Remora add a target for net461 makes my life a lot easier because then I can just use Remora everywhere and not have to worry about ifdefs and fighting the dotnet compiler.

Tangentially, this issue comes up because Microsoft broke netstandard2.0 when the released netcore3 and never went back to fix it. This breakage made it so netfx461 does not support netstandard2.0, even though the compatibility chart says otherwise. Adding this change allows myself and others a path to properly migrate.