NET.addAssembly .net core 3.1
조회 수: 41 (최근 30일)
이전 댓글 표시
I've made a simple dll to demonstrate calling C# from Matlab. When I run with the dll built using .Net Framework 4.7.2 the call to Net.Assembly works as expected. When I call a dll built using .Net Core 3.1 I get the following error message.
"Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
I suspect there may be a Matlab config file that needs to be changed to support this runtime version.
Anyone else run into this problem and have solution?
댓글 수: 0
채택된 답변
David Garrison
2022년 7월 13일
Starting In R2022b, on supported Microsoft® Windows platforms, MATLAB will support loading libraries compiled for .NET 5 and higher and for .NET Core, as well as existing support for the Microsoft .NET Framework. You will be able to select a .NET environment, use the dotnetenv function.
댓글 수: 4
David Garrison
2022년 8월 2일
Should be in the R2022b prerelease. Of course, support is for Windows only and you must have .Net 5 or higher installed.
Thomas Stauffer
2022년 8월 3일
Ok thanks. We can confirm that this works if dotnetenv("core") is called before calling NET.addAssembly.
추가 답변 (4개)
Robert Jack
2020년 3월 23일
I enquired with Matlab support last summer regarding .NET Core / Matlab interop and it is not supported although I was assured that the team were working on it. I've looked at the releases since then (R2019b and R2020a) and MATLAB/.NET core is still not supported and I have not seen any official information released by MATLAB regarding timescales for .NET core support.
This is a bit disappointing as Microsoft are recommending .NET Core for new developments. In fact last week they announced .NET 5 preview 1. As .NET 5 is the next major release of .NET and will unify .NET on a single platform and that this is what they are recommending that all new applications are built with it, it is surprising the Matlab have not got round to supporting .NET core, particularly as it now several years old.
댓글 수: 3
Robert Jack
2020년 3월 24일
It would be nice if someone from Mathworks could comment on likely timescales for the support of .NET Core
Urmila Rajpurohith
2020년 3월 24일
As Robert mentioned R2019b, the MATLAB Interface to .NET does not support .NET Core. The developers are considering adding support for this in a future MATLAB release. Please find the current system requirements for using the .NET Interface below.
댓글 수: 6
David Garrison
2021년 3월 31일
Robert, we are actively working on support for .Net 5. We will support Windows first, then cross-platform. We will support .Net 6 as well. As you probably know, we do not pre-announce feature release dates but we are trying to get .Net 5 support as soon as we can.
Michael
2022년 7월 13일
Above, @David Garrison mentioned active work on supporting .NET v5. But that was over a year ago. And over two years since this issue was originally raised.
.NET Core has been out for quite a while now, and .NET Standard longer than that. The lack of a resolution to this problem points to the "active work" being shelved or suspended.
While I understand and support the mantra of "we do not pre-announce feature release dates", this is too long. Either actually put some effort into this or outsource it to a competent consultant who can port the code for you ... it isn't rocket science, as anyone with a .NET decompiler can easily see.
Robert Jack
2021년 3월 15일
There is nothing in the release notes about .NET Core. Microsoft has announced .NET 6 preview 2 now. It's not obvious that anyone from Matlab looks at these kind of posts very often or has much current interest in supporting .NET Core judging by their level of engagement.
댓글 수: 8
Chris Morris
2022년 3월 16일
I've no information to add, but could I possibly add myself to the list of people this feature would be handy for? dotnet core runs on Linux, which is my target environment for a project I'm working on (which uses matlab as well).
David Garrison
2022년 8월 3일
Support is in R2022b. You can try it in the 22b prerelease
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!