Using C# Assembly in MATLAB

4 次查看(过去 30 天)
Eduard Mazur
Eduard Mazur 2019-9-23
Hello everybody
I'm trying to work with C# assembly in MATLAB, so about my problem:
I created c# assembly with using third party librarys (Siemens.Engineering for work with their product TIA Openness).
And then I have problem with loading namespace and class in variable:
Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source: mscorlib
HelpLink:
Then I wrote desifer LoaderExeption
try
namespace.class
catch ex
end
ex.ExceptionObject.LoaderExceptions.Get(0).Message
And this give me more specific message:
Could not load file or assembly 'Siemens.Engineering.Contract, Version=1501.0.2801.1, Culture=neutral, PublicKeyToken=37a18b206f7724a6' or one of its dependencies. The system cannot find the file specified.
Look like assembly can't find this library. And this happen only if I have several methods witch use Siemens.dll.
But the mistery is, if assembly have only one method, it's work perfectly in matlab without any restrictions..
Maybe I need to load something like AssemblyResolve in MATLAB??

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by