.NET Core does not support loading assemblies
이전 댓글 표시
We use MATLAB R2022b to access .NET 6 libraries. This works as long as the library does NOT reference some other assemblies in the cache. E.g. one of the .NET 6 libraries we use accesses System.IO.Ports (via official nuget package manager), this library then cannot be loaded in MATLAB R2022b as we get the following error then:
Message: Could not load file or assembly 'System.IO.Ports, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Is there a workaround, or is this something MATLAB will support in the future?
댓글 수: 3
raptor_claw
2023년 2월 13일
I'm dealing with the same issue. Created a simply package that contains a class that utilizes System.Text.Json and the NET.addAssembly command loads all parts of the assembly that do not use the System.Text.Json package.
Would love to hear from the Mathworks Team on support/workarounds.
Henrik Teneberg
2023년 9월 14일
I am also affected by this. The obvious workaround is to set up a Publish Profile for your .NET project that has the flags:
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
This basically means shipping all .NET dlls with every deploy though.
I am also looking forward to a fix/comment from Mathworks.
Thomas Stauffer
2023년 9월 14일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Microsoft .NET에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!