lifebeyondfife / Decider

An Open Source .Net Constraint Programming Solver
MIT License
150 stars 21 forks source link

netstandard2.0 NuGet Package for .NET Framework support #43

Closed Jimmacle closed 3 years ago

Jimmacle commented 3 years ago

Hi, I'm currently experimenting with using your project to implement a package management system in one of my own projects (source here). My project has to support .NET Framework for reasons out of my control which only supports up to netstandard2.0. Would it be possible for you to add a netstandard2.0 target to the NuGet package so .NET Framework projects can consume it directly? I have tested retargeting it myself; all the tests still pass and the library appears to work fine as far as I have tested it.

lifebeyondfife commented 3 years ago

Hello @Jimmacle. Thanks for your interest in Decider.

I can see I upgraded .Net Standard from 2.0 to 2.1 on 8th January this year (https://github.com/lifebeyondfife/Decider/commit/3b25c7c23597cd3a1cb41f312715afd5628ae4f3). Looking at nuget.org, if you target v0.3.12, you will be able to use Decider with .Net Framework. The only product feature you'll miss is the XOR ^ operator.

I'm hesitant to downgrade library versions in general because (a) another user may depend on a feature in .Net Standard 2.1 and (b) newer is better (even though in many cases it isn't).

The next planned work for Decider is around ci/cd pipeline automation, to make builds more deterministic. I cannot make any promises, but I'll consider how I can automate a branch for patching changes to make .Net Framework compatible nuget packages for a period of time.

Let me know if that helps, and thanks again for reaching out.

Cheers, Iain

Jimmacle commented 3 years ago

Thanks for the response, for now I'll either use that version or pull the source code in as a submodule. Regarding your build automation, it's possible to target netstandard2.0 and netstandard2.1 at the same time by setting the target framework version in the project to <TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks> and using multi-targeting within the NuGet package. As long as this project itself doesn't depend on APIs added in 2.1 that could leave package consumers free to use either framework version depending on their requirements.

lifebeyondfife commented 3 years ago

Ah, nice. Thanks, I'll look into that (and keep this issue open until resolved).

I must confess, it's been over 6 years since I wrote any C# in the day job so I appreciate the pointer regarding .Net build/framework management.

Jimmacle commented 3 years ago

No worries, I have the opposite problem where I know a decent amount about C# features but next to nothing about writing constraint solvers :) If you're open to feedback/pull requests I'd be glad to comment on or contribute C# related improvements to the implementation.

lifebeyondfife commented 3 years ago

Please do, happy to get feedback about pain points or potential improvements. Much appreciated.

lifebeyondfife commented 3 years ago

Decider has been updated to support netstandard2.0 in addition to netstandard2.1. Please update your nuget package to latest (v0.4.3). Thanks again for raising the issue. I've started looking into your other feedback too but that will take longer to test changes.