3 ms·
If you try to do it in one big hit it will be hard but you don't have to do that. You can move it over piecemeal. You can use multi-targeting to move parts of
by uk_programmer 6y ago
If you try to do it in one big hit it will be hard but you don't have to do that. You can move it over piecemeal.
You can use multi-targeting to move parts of your code over to .NET Standard. So if you start with your base projects and move your way up, gradually your code will become compatible between .NET core and .NET Framework. This will help you remove any .NET Full Framework / Windows specific bits. Where you have to have things that are specific to each OS you can then just configure your DI so it will inject the Windows specific / Linux specific implementation.
For those that are not aware of multi-targeting here is a great article on it:
https://weblog.west-wind.com/posts/2017/Jun/22/MultiTargeting-and-Porting-a-NET-Library-to-NET-Core-20 https://weblog.west-wind.com/posts/2017/Jun/22/MultiTargetin...
- moron4hire 6y agoI used the multitargetting approach over the last year to convert most of my code to .NET Standard (about 50KLOC). The latest .NET Standard 2.0 and .NET Core 3.1 make it pretty easy. MS' previous attempts at multiplatforming were hit or miss, but they really seem to have finally gotten it right. Part of what has made it so much easier is the new "SDK Style Project File Format". It makes manually editing the csproj file mostly easier than using the VS editor for the vast majority of tasks. Which, for better or worse, is necessary to get some of the latest features. Got example, you can enable most of the latest C# 8 features for .NET Framework (which officially is stuck at C# 7.2).
- uk_programmer 6y agoThe old multiplatforming options I don't think anyone bothered with. It certainly much easier than before.