MATLAB Answers

NET.addAssembly .net core 3.1

72 views (last 30 days)
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 Comments

Sign in to comment.

Accepted Answer

Urmila Rajpurohith
Urmila Rajpurohith on 24 Mar 2020
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.

  1 Comment

Robert Jack
Robert Jack on 11 Jun 2020
And neither does R2020a. What is the time frame for .NET CORE support? .NET 5 will be released later this year, which is effectively .NET Core. The last released version of .NET Framework (4.8) is over a year old now, and that represents the last version of .NET framework.

Sign in to comment.

More Answers (1)

Robert Jack
Robert Jack on 23 Mar 2020
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.

  2 Comments

Richard Troup
Richard Troup on 23 Mar 2020
Thanks for the response. I really thought this was a problem related to the specific version of .Net Core not that ALL version are not supported.
Robert Jack
Robert Jack on 24 Mar 2020
It would be nice if someone from Mathworks could comment on likely timescales for the support of .NET Core

Sign in to comment.