MWArray assembly failed to be initialized in C#
조회 수: 10 (최근 30일)
이전 댓글 표시
I have developed a project of"Automatic Number Plate Reader" in matlab and I want to call this project in C# windows application for further process.But when i implement this in C# i got a error as "MWArray assembly failed to be initialized". Wherein I have generated all the dll files in matlab and added it in the reference of the C# project from the deploytool in matlab. And MWArray.dll is also been added. I am using 2013a version of matlab and 2012 version of Visual Studio. Any help regarding this is quite helpful.
댓글 수: 1
Wenchao Tao
2018년 5월 3일
Hi, I'm wondering if you have found the solution to the error of "Error initializing CTF Archive". I have this error randomly when use compile dll in a C# application. Tried to clean the MCR temp folder, reset the MCR temp folder location and still not able to fix this random error.
채택된 답변
Matthew Monreal
2015년 5월 18일
I came across your problem when I was trying to solve my own. Now I got back to you since I've managed to solve it.
First of all it appears that the MWMCR is only compatible up to .net framework 3.5.
Second make sure that you are generating the *.ctf file when building your function in MATLAB. you need to untick the option where it says that the .ctf is embedded in the application. Its in the settings of the deploytool itself.
Third when after you create the fill debug the program until you reach the code part in the static constructor of your classwhere it finds the assembly location and take note of the folder location.
string ctfFilePath= assembly.Location;
You would need to manually copy and paste the *.ctf file to that location and it should work.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!