azurefx / DotNET.jl

Julia ❤️ .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.NET Framework support

Titas22 opened this issue · comments

Hi,

Are there any plans to add .NET Framework support in the future? In particular I am interested in versions 4.7/4.8.

Is Framework not supported because it is not really cross-platform compatible and woud mainly work on windows? Or does it simply need some work to get it working? If so and since you've already done all this great work to support .NET Core, do you know what specifically is missing to support the Framework as well.

Would be nice to have a list of what is missing to make this happen.

I don't have this plan at present because there are two main considerations:

First, according to Microsoft, .NET Framework 4.8 will be the last version of .NET Framework. Starting from .NET 5, there will be no distinction between "Windows-only .NET" and "cross-platform .NET", and .NET includes most of the features provided by .NET Framework. Due to the backward compatibility of the .NET runtime, if you have an assembly developed for .NET Framework 4.7/4.8, there is a high probability that it will run on subsequent .NET versions. Therefore, supporting .NET Framework seems less necessary.

Second, the .NET Framework hosting APIs are exposed as COM interfaces, and it is cumbersome to implement interoperability with COM in Julia. For API documentation, please refer to this link.

Please correct me if I am wrong. If you're interested in adding support for .NET Framework, I'd be glad to help.

You're right that the future versions of .NET will all be compatible between platforms and it should be fairly easy to upgrade most projects to .NET 5/6/7. However, in my case (and I'm sure there will be many others in similar position), there are 3rd party projects that I must use which for one or other reason have not yet upgraded and/or are not even planning to. In those cases the only real solution is to find a way to support .NET framework in Julia. There might be a way to write wrappers to get this working through Python or maybe .NET Standard, but that would add overhead and be more complicated than it could be.

Second point sounds like a fairly valid reason, I have not really used COM much and definitely not in Julia so can't really comment on how difficult it would be.

I might take a look when I have some time but not sure I'm there yet with Julia to be able to add .NET Framework support 😅

I've tried implementing COM calls in Julia a few years ago, but didn't come up with a convenient package. If I have time I'll finish it first and publish as a standalone package.