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!