lslib icon indicating copy to clipboard operation
lslib copied to clipboard

Move to .NET Core

Open erri120 opened this issue 2 years ago • 7 comments
trafficstars

As great as these libraries are, they're currently being held down by the .NET Framework. Only recently did the project upgrade to .NET Framework 4.7.2, but with the rise of Baldur's Gate 3, more and more developers will want to use this project and don't want to depend on obsolete technology.

Any project that wants to use these libraries would be forced to also use the .NET Framework, instead of .NET 6/7, and would be unable to create cross-platforms tools. They would be unable to profit from the multitude of enhancements that the newer .NET version bring over the .NET Framework, such as better performance, new language features (polyfill is a thing, but that only goes so far) and being able to target Windows and Linux (Steam Deck and Linux Desktop).

I understand that porting a large and old code base is not something that can be done on a whim, so let me know if you have any questions. Microsoft also has a porting guide and various tools exists to help in this endeavor.

erri120 avatar Aug 12 '23 15:08 erri120

While I agree with this, do keep in mind that ConverterApp uses Winforms and is also the tool that most people would use. That is not easily converted to something crossplatform as Winforms is no more, WPF is Windows-only. So the next step would either be web-based UI (and/or Blazor) or MAUI.

LennardF1989 avatar Aug 14 '23 15:08 LennardF1989

While I agree with this, do keep in mind that ConverterApp uses Winforms and is also the tool that most people would use. That is not easily converted to something crossplatform as Winforms is no more, WPF is Windows-only. So the next step would either be web-based UI (and/or Blazor) or MAUI.

You can still move to .NET 6/7. WinForms and WPF are not really recommended for new projects, but it's still supported. There is also Avalonia, which is cross-platform.

The important aspect is getting the libs over to the new .NET.

erri120 avatar Aug 14 '23 15:08 erri120

See up.

LennardF1989 avatar Aug 14 '23 18:08 LennardF1989

Same, I am looking to use the Granny2 part specifically for an external project so I would love to see it in either standard or core. Would cross platform (Without wine) even work because of the Granny2 wrapper bindings?

MAUI doesn't support Linux (Boo) so Avalonia is probably best for desktop UI.

CryoMyst avatar Aug 22 '23 19:08 CryoMyst

Granny support needs to be able to load granny2.dll, which is a windows x64 native binary, so a .NET Core version likely wouldn't support GR2 conversion, or only in very limited circumstances since binding platform specific binaries there is finicky.

Norbyte avatar Aug 22 '23 19:08 Norbyte

PInvokes (Or better yet, LibraryImport) would work for granny2 under windows/wine, so maybe targeting net6.0-windows is probably the best way to go initially for that specific library. Could we move some of the bindings to use https://github.com/arves100/opengr2 instead?

CryoMyst avatar Aug 22 '23 19:08 CryoMyst

Yea, .NET 6 would probably be the most likely target.

Granny2.dll is needed for the proprietary BitKnit1/2 decompressor/compressor functions, which are not implemented by OpenGR2 (i.e. it cannot read BG3 GR2 files at all).

Norbyte avatar Aug 22 '23 21:08 Norbyte