ankhansen
ankhansen

Reputation: 933

.Net Core migration path from 2.1 using .Net 4.5 libraries

We have a running .Net Core 2.1 API. For legacy reasons we share a set of business logic layer assemblies currently in .Net 4.5 because they are used by our Windows WinForms .Net 4.5 application as well.

I would like to upgrade the API to .Net Core 3.1, but as that requires netstandard21, which .Net 4.5 won't be, I would like some feedback on my options - if I understand correctly.

As I see it we are stuck for now.

If I upgrade the legacy assemblies to netstandard21 - I can't use them from the .Net 4.5 WinForms app

If I keep the legacy assemblies on .Net 4.5, I can't use them in the .Net Core 3.1 - because they are not netstandard21

.Net Core 3.1 supports WinForms - so will it be a feasible way to go for porting the old WinForms app to .Net Core 3.1 - if all third party libs can be found in .Net Core 3.1 compatible versions.

The final option is to wait for .Net 5, maybe slowly start working on a migration with the previews, but I assume that requires our third party libraries to support .Net 5 as well.

Has anyone been in the same offset - having a .Net Core Api mixed with .Net 4.5 libraries - and how are you planning to move forward?

We have 10 year+ legacy code - so re-implementing is not an option.

Best regards /Anders

Upvotes: 0

Views: 45

Answers (1)

Kahbazi
Kahbazi

Reputation: 14995

You could create a shared project and add your shared business logic there and then create two projects, one for WinForms and one for ASP.NET which have reference to the shared project.

You can read more about shared project here: Shared Projects code sharing

Upvotes: 1

Related Questions