Lombiq / Hastlayer-SDK

Turning .NET software into FPGA hardware for faster execution and lower power usage.

Home Page:https://hastlayer.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrate to .NET Core

Piedone opened this issue · comments

Migrate the whole SDK to .NET Core in anticipation of .NET 5. This also means to get rid of Orchard (but potentially use relevant pieces of Orchard Core).

IlSpy libraries need to be updated first, so see: #20.

We'd need to work on substituting the following Orchard features:

  • Automatic dependency injection: registrations for IDependency and its derivatives can potentially be provided in a separate Helpful Libraries package, or register everything by hand into the .NET Core container.
  • Logging
  • Events (there are a few IEventHandler implementations; they can be kept as simple IEnumerable<TEventHandler> dependencies; OrchardCore.Modules.InvokeExtensions can be used to invoke them without surfacing exceptions if necessary to swallow exceptions from events)
  • Virtualized file access with IAppDataFolder (IFileStore can be used with an implementation from the OrchardCore.FileStorage.FileSystem package).
  • ex.IsFatal() (the OrchardCore.Abstractions package contains it)
  • IClock (the implementation is in the OrchardCore package)
  • Caching (IMemoryCache, MemoryCache can be used from Microsoft.Extensions.Caching.Memory)
  • Nunit 2 tests, possibly by migrating to Nunit 3, see: https://davembush.github.io/nunit-2-vs-nunit-3-what-you-need-to-know/ Or use xUnit which Orchard also uses, see this article on a comparison to Nunit: https://dev.to/hatsrumandcode/net-core-2-why-xunit-and-not-nunit-or-mstest--aei Moq can be continued to be used.

Once this is done the note on the usage of Orchard in the Readme should be changed too. Do a search for "Orchard" in the whole solution to check whether everything that refers to Orchard still makes sense.

All packages we use apart from the old IlSpy ones target .NET Standard, so we're good. However, the Catapult libraries are Windows-only, so we need to somehow compartmentalize the Catapult-using parts. Maybe we'll need a separate consumer sample for that too (like Hast.Samples.Consumer).

The class libraries should target .NET Standard, the console apps the latest .NET Core. The KPZ WinForms app needs to be ported over to .NET Core WinForms, see this guide.

For some tips also see this article: https://www.telerik.com/blogs/dotnet-is-dead-long-live-dotnet

Follow-up: #35

JIRA issue

Done, will be part of the next release.