SharpAudio icon indicating copy to clipboard operation
SharpAudio copied to clipboard

.NET Standard 2.0 support?

Open YoshiRulz opened this issue 2 years ago • 8 comments

Having switched to Vortice.Windows, are you now able to release a version targeting .NET Standard 2.0 (or any version of .NET Framework)?

YoshiRulz avatar Jan 24 '22 03:01 YoshiRulz

.NET Standard 2.1 is too high for you?

feliwir avatar Jan 24 '22 06:01 feliwir

Yes. If you weren't aware, .NET Framework 4.8 (the latest) can't consume .NET Standard 2.1 assemblies. We're trying to gradually port our app to .NET 6 which means moving as much as possible to the lowest common denominator, which is .NET Standard 2.0, to reduce the workload of the final move.

YoshiRulz avatar Jan 24 '22 07:01 YoshiRulz

I just checked, the reason i'm using 2.1 is that we make extensive use of Span<T>. Supporting .NET Standard 2.0 would be a lot of effort and with .NET 5/6 being available i don't see a reason that .NET Framework support would be a requirement.

Is there any particular reason you can't migrate your project to a newer .NET version?

feliwir avatar Jan 24 '22 08:01 feliwir

Many reasons, which are listed in the linked Issue above. With great effort we could probably replace all the libraries at once, at the cost of losing Linux support and blocking future support for macOS.

Could you please try adding the extra target with the System.Memory backport package?

YoshiRulz avatar Jan 24 '22 09:01 YoshiRulz

Looking at your issue linked above, there seem to be a lot of good reasons porting your software to .NET 5. Many of the projects you've linked above do work without any issues in .NET 5 (-> they target SlimDX aswell).

The only issue i can see is SlimDX which is an abandoned and dead project. I propose moving to Vortice.NET or using the great Veldrid library as a cross-platform graphics backend (replacing OpenTK & SlimDX both).

To be precise these libraries you've mentioned as issues work effortlessly: NLua 1.6.0 -> .NET Standard 2.0 Win Forms -> .NET 5 (comes with .NET 5) OpenTK 4.6.7 -> .NET Standard 2.1

Since most of your other dependencies are > .NET Standard 2.0 in their current version i don't see adding an extra target - Sorry. If you need any help porting to .NET Core i'll gladly help though

feliwir avatar Jan 24 '22 10:01 feliwir

By the wontfix label I assume you don't want me to PR my branch which resolves this (with a hack).


If you can help us switch to Veldrid I'd really appreciate it. In all honesty, I don't understand low-level graphics at all, and the dev who contributes most to that code isn't interested in refactoring. There's a proof-of-concept branch which I was able to hack together, and we're tracking it as TASEmulators/BizHawk#3033.

YoshiRulz avatar Jan 24 '22 15:01 YoshiRulz

I think going down to .NET Standard 2.0 would be acceptable if it doesn't require any quirks or technical workarounds. I looked at your branch and it's mostly a hack (as you mentioned), which is okay for your usage, but would not really be that nice for the majority if the SharpAudio users, since it degrades performance. The goal should be to encourage everyone to use .NET Core atleast, since that's where the entire ecosystem is shifting towards.

Not sure if you know, but i did this project (SharpAudio) mostly exclusively for https://github.com/OpenSAGE/OpenSAGE (which i work on), and we're quite happy with our "modern" approach to GameDev in C#. We're using ImGui for UI, which can be integrated into Veldrid (same author).

The problem in your case would be that the entire UI framework had to be rewritten aswell, since WinForms & Veldrid aren't really a portable combination.

feliwir avatar Jan 24 '22 15:01 feliwir

I would like to note that Xamarin and UWP are both still .NET Standard 2.0, and will likely never get proper support for 2.1. (And unfortunately .NET MAUI and WinUI 3 are too immature to be viable replacements at the moment.) In my opinion, introducing polyfills for new APIs isn't really a hack.

yoshiask avatar Apr 14 '22 18:04 yoshiask

Why is this not being considered?

yoshiask avatar Sep 29 '22 16:09 yoshiask