News for hackers. Stuff that matters.
Re:Mobius – .NET runtime running on .NET Core by triangleman on Tuesday April 07, 2020 @12:31PM (#22804693)
The big question, for me at least, is can this be used to containerize a .NET application without having to package a full Windows OS into the container?
Re:Mobius – .NET runtime running on .NET Core by 9wzYQbTYsAIc on Tuesday April 07, 2020 @01:13PM (#22805207)
In case you weren’t yet aware, .NET Core runtime can be containerized on Linux. .NET Framework is the (mostly) Windows dependent runtime. Mono is the open / Microsoft supported translation of .NET Framework to Linux.
Re:Mobius – .NET runtime running on .NET Core by triangleman on Tuesday April 07, 2020 @01:25PM (#22805345)
Right but converting a big application to .NET Core is hard. Is this project not sort of an emulator to allow a legacy .NET Windows app to run on .NET Core? I had better read TFA better.
Re:Mobius – .NET runtime running on .NET Core by bob1029 on Tuesday April 07, 2020 @02:05PM (#22805750)
Not necessarily. It really depends on your platform and 3rd party library usage scope. There also exist very helpful shims for accessing legacy .NET Framework functionality as long as you are running your .NET Core applications on windows:

https://www.nuget.org/packages/Microsoft.Windows.Compatibili...

The idea here being that you can quickly move to .NET Core using the compatibility shim, and then incrementally work your way off of it. .NET 5 will support the exact same concepts, so it still makes sense to engage this task if you want to get onto the new bandwagon.

Re:Mobius – .NET runtime running on .NET Core by GordonS on Tuesday April 07, 2020 @01:33PM (#22805436)
I've never tried it, but from memory I think you can run .NET Framework under Wine, which presumably you could put in a container.

But honestly, I think your time would be better spent moving it to .NET Core. I've moved a few big apps, and while I wouldn't class it as "easy", it wasn't really that difficult, more time consuming that anything.

Re:Mobius – .NET runtime running on .NET Core by efdee on Tuesday April 07, 2020 @01:34PM (#22805451)
You're postponing the inevitable. .NET 5 is .NET Core.
Re:Mobius – .NET runtime running on .NET Core by stragies on Tuesday April 07, 2020 @02:12PM (#22805825)
Yes, but many legacy .Net apps were delivered without source-code, the original developer is not available, and now people like OP and me are looking to run this old crap (for paying customers) without having to maintain a dedicated Windows VM.
Re:Mobius – .NET runtime running on .NET Core by uk_programmer on Tuesday April 07, 2020 @05:25PM (#22807644)
Have you tried decompiling it? Telerik Just Decompile will decompile it back out to C#. It ultimately depends on agreement you had with the original developer as to whether it is legal or not.
Re:Mobius – .NET runtime running on .NET Core by triangleman on Tuesday April 07, 2020 @03:43PM (#22806738)
Even with source, it's still a big undertaking to convert to .NET Core but efdee is right, it's just postponing the inevitable. I'm sure we will go to .NET 5 soon enough.
Re:Mobius – .NET runtime running on .NET Core by uk_programmer on Tuesday April 07, 2020 @05:37PM (#22807753)
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/MultiTargetin...

Re:Mobius – .NET runtime running on .NET Core by moron4hire on Tuesday April 07, 2020 @06:40PM (#22808244)
I 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).

Re:Mobius – .NET runtime running on .NET Core by uk_programmer on Tuesday April 07, 2020 @11:00PM (#22809641)
The old multiplatforming options I don't think anyone bothered with. It certainly much easier than before.
Re:Mobius – .NET runtime running on .NET Core by int_19h on Tuesday April 07, 2020 @06:00PM (#22807948)
The hard part is exactly all those legacy APIs that are often Windows-specific. This is just a custom implementation of the CLR; it doesn't do anything about the libraries, so far as I can tell.
Re:Mobius – .NET runtime running on .NET Core by vesh on Tuesday April 07, 2020 @12:39PM (#22804766)
This is just the .Net runtime most application will probably depend on the .net framework libraries so not really.
Re:Mobius – .NET runtime running on .NET Core by bob1029 on Tuesday April 07, 2020 @02:01PM (#22805713)
"containerize" is a very loaded/subjective term. In my experience, the best container-like boundary for .NET Core applications would be the process itself. AppDomains and related fanfare don't really exist anymore, and the process is the only common abstraction across all platforms that shares most of the same principles. It's always been the best grain to go along IMO.
Re:Mobius – .NET runtime running on .NET Core by solarkraft on Tuesday April 07, 2020 @02:33PM (#22806041)
I assume the author really means "run in a Linux context, without Windows". Otherwise, if you really just want to containerize and don't mind running an instance of Windows, you could use a Windows container.
Re:Mobius – .NET runtime running on .NET Core by stragies on Tuesday April 07, 2020 @02:09PM (#22805780)
If I read TFA correctly: Maybe in a couple of years, if a 100 devs jump on the project. The author is currently in the "Proof-of-concept" stage. Nevertheless an interesting project and write-up. Probably to late to run old legacy .Net Apps that -unfortunately- you "inherited" without source-code.
Re:Mobius – .NET runtime running on .NET Core by runfaster2000 on Tuesday April 07, 2020 @04:03PM (#22806944)