Using Matlab functions in C# (2009b)


Matlab has changed a bit of the command “deploytool” in 2009a and 2009b. To see how to use matlab functions in 2009a, see my previous post here.

In 2009b, this has changed a bit and this post will show you how to accomplish the same task in Matlab 2009b.

  1. Start Matlab and key in “DeployTools”, Select “.NET assembly”, and the project location and name

     M2009b_A

  2. After clicking the OK button…

    M2009b_B 
    M2009b_C

  3. In the “Build” Tab, Add a class which corresponds to the .Net Class Name, and matlab .m files, each .m file (i.e. a matlab function) corresponds to a method of the .Net Class.

     M2009b_D

  4. click the Build button.

    M2009b_E M2009b_F
    Particular note that your project folder structure should be supposedly SIMPLE, and better avoid spaces or less frequently used chars, otherwize, it is very likely to fail in the build process.

  5. Now start a C# Winform project, add a reference to the output built by Matlab

    M2009b_G 
    In the object brower, you can see that the class “VoronoiCell” appears, and it has two important functions, as expected, with different overloadded prototypes!

    M2009b_H M2009b_I
    What a cool feature!

  6. Now, add another assembly called “Mwarray.dll”, located in \toolbox\dotnetbuilder\bin\win64\v2.0 folder.
  7. Create a C# project, and test with some code, for instance:
       1: MyVoronoiCell vgc= new MyVoronoiCell();

       2: double[] X = { 0.5, 0, -0.5, -0.2, -0.1, 0.1, 0.1 };

       3: double[] Y = { 0, 0.5, -0.5, -0.1, 0.1, -0.1, 0.1 };   

       4: MWArray[] Results = (MWArray[])vgc.GetVoronoiEdge  

       5:                     (2,    

       6:                     MWNumericArray)X,    

       7:                     MWNumericArray)Y);   

       8: double[,] EdgeX = (double[,])Results[0].ToArray();   

       9: double[,] EdgeY = (double[,])Results[1].ToArray();

  8. Now, problem comes. If you run the program, exception will be thrown at Line 1, and there are a few possible cases
    1. {"Could not load file or assembly ‘MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format."}

      This is mostly due to the absense of MWArray.DLL in GAC, and the simplest solution is to add it to GAC by typing

      gacutil /i MWarray.dll

    2. {"The type initializer for ‘MathWorks.MATLAB.NET.Utility.MWMCR’ threw an exception."}, {"Trouble initializing libraries required by Builder NE.\n"}, "   at MathWorks.MATLAB.NET.Utility.MWMCR..cctor()", or {"Trouble initializing libraries required by Builder NE.\n"}  or

      {Unable to load DLL ‘mclmcrrtXXX.dll’} or

      MathWorks.MATLAB.NET.Utility.MWMCR.mclmcrInitialize(); at MathWorks.MATLAB.NET.Utility.MWMCR..cctor()

      For these kind of applications in x86 platform, the solution is to run MCRInstaller.exe to install the Matlab Compiler Runtime, it should work once MCR is installed. Restart OS after MCRInstaller.exe is installed!!! Restart VisualStudio, Matlab!!!

Now rebuild the project, all is fine.

65 thoughts on “Using Matlab functions in C# (2009b)

  1. marko

    Error 1 The type or namespace name ‘MWArray’ could not be found (are you missing a using directive or an assembly reference?) C:\Users\Ultimate\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs 9 7 WindowsFormsApplication1

  2. xinyustudio

    Search MWArray.dll in your hardrive, and then add thie reference to your project. Most possible folder is ‘MatlabInstallDir\toolbox\dotnetbuilder\bin\win64\v2.0’ or ‘MatlabInstallDir\toolbox\dotnetbuilder\bin\win32\v2.0’.
    Cheers!

  3. Jack

    Would it be possible to post a link where we can download all the actual files involved (.m and .sln .cs)? Also for the R2009a version? Thanks

  4. xinyustudio

    If you encounter the following exception:

    “The type initializer for ‘xxxxxxx’ threw an exception. —> System.BadImageFormatException: Could not load file or assembly ‘MWArray, Version=2.10.0.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

    You should check if your C# program is configured in x86 or x64 configuration. In VisualStudio 2010, when you start programming, the default mode is x86 configuration, even though your windows OS is 64 bit. After changing the configuration to x64 in VS2010, the exception should disappear now.

    Enjoy.

  5. In this case: “You should check if your C# program is configured in x86 or x64 configuration. In VisualStudio 2010, when you start programming, the default mode is x86 configuration, even though your windows OS is 64 bit. After changing the configuration to x64 in VS2010, the exception should disappear now.” Ok the exception disappeard but a new exception appear… TypeInitializationException was unhandled and the connectivity Visual Studio 2010(My C# program) with Matlab R2010a failed!!!!
    Do you have any idea on how to deal with this???
    Thanx in advence!

  6. This exception-TypeInitializationException-could happens because IntelliTrace debugging is available only for x86 applications,not for x64…
    If you want i could post the code here. The same code works perfect in Visual Studio 2008 and Matlab R2009b,but in VS2010 and Matlab R2010a doesn’t…
    This is my problem in the last 5 days…any solution could be appreciated!!!
    Thank you for your time in advance!

  7. xinyustudio

    Chirstos75,

    I cannot reproduce the exception, and you need give more info in order to troubleshoot this.

  8. bleonardo

    Did you notice any memory leak using this code? Every code I tried to run (even the matlab examples) don’t free the allocated memory at all… Even when I call Dispose(), the memory is not released… Do you have the same problem?

  9. bleonardo

    I’m using a memory profiler in a program that just instantiates a class (from matlab) or a MWArray and then disposes everything… The profiler show a large memory increase and no release at all… And I’m not even calling any method from the class… The profiler shows some event handlers from MathWorks.MATLAB.NET.Utility that could be causing this problem, but I could not find any way to access this events…

    I guess it’s something that start to happen from MCR 7.11… I was just wandering if anyone had the same problem…

  10. xinyustudio

    Bleonardo,

    This is a very interesting comment, and I agree that Matlab DotNet handshakeing still has some technical problems. In addition to the meomory leak problem as you have pointed out, I found some functions are still unavailable, for instance, if your *.m file contains some LAPACK algorithm, when you compile the source into the DLL assembly and call it in DotNet, you might encounter an exception about the “mllapack.dll”. Matlab ‘s answer to this is that this is a SSE2 problem, see here for details. But I am pretty sure that my PC supports SSE2 instruction sets.

    I would expect Matlab can fix these problems in the future update, and should you have any solutions, please let me know. Thanks.

  11. Lakshmi Prasad

    Hi I receive the following error:
    Trouble initializing libraries required by Builder NE.

    The type initializer for ‘MathWorks.MATLAB.NET.Utility.MWMCR’ threw an exception.
    The type initializer for ‘MathWorks.MATLAB.NET.Arrays.MWArray’ threw an exception.

    Stack Trace :
    System.TypeInitializationException: The type initializer for ‘MathWorks.MATLAB.NET.Arrays.MWArray’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘MathWorks.MATLAB.NET.Utility.MWMCR’ threw an exception. —> System.Exception: Trouble initializing libraries required by Builder NE.

    at MathWorks.MATLAB.NET.Utility.MWMCR..cctor()
    — End of inner exception stack trace —
    at MathWorks.MATLAB.NET.Utility.MWMCR.SetResourceManager(ResourceManager resourceManager)
    at MathWorks.MATLAB.NET.Arrays.MWArray..cctor()
    — End of inner exception stack trace —
    at MathWorks.MATLAB.NET.Arrays.MWArray.op_Implicit(Double scalar)

    I use 64 bit Windows 2008 R2..How do i resolve this, i have tried the above steps, but not able to overcome this issue.

  12. Pingback: 2010 in review « Xinyustudio

  13. Lakshmi Prasad

    Hi Christos 75 / XinyStudio,

    Is there a way to overcome the System.TypeInitializationException exception in Matlab 2010a in 64 bit?

    Regards,
    Lakshmi Prasad

  14. xinyustudio

    Lakshmi,

    There is nothing special to tackle the System.TypeInitializationException exception in Matlab 2010a and 2009 a/b in x64 setting.The same solution applies. If you encounter weird problems, I suppose that it is most likely related to your OS problems. Try to get it done on a clean OS or virtual OS (e.g. Virtual Box or VMWare), and see if the same problems pop up.

    Hope this helps.

  15. xinyustudio

    Sara,

    The use of particular functions(e.g. neural network) is nothing special to use a simple matlab function, you just wrap it in the function, compile and run! That is it!

  16. Lakshmi Prasad

    Hi,

    In the same system, i tried creating Test console application and WinForm application and tried instantiating the MWArray and MWNumeicArray and these go fine without any issue.

    Basically i ported my original application from 32 bit and tried the same using this test application. Everything goes fine in my test app. and the Project properties are also same when i compare both these…
    I have not tried this using in a Clean PC.Let me do that.

    Thanks,
    Lakshmi Prasad

  17. I meet the problem of “Could not load file or assembly ‘MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”, and I have tried the method that you have mentioned, but it doesn’t work. It is a 32-bit machine and a Matlab2010a was set up actually. Would you please give me some advice?

  18. xinyustudio

    James, I need more details to help out.
    What functions have you encapsulated? Did you install x86 version of Matlab?

  19. xinyustudio

    James,

    Search with the keyword “matlab” in this blog, there are more than one blog entries about programming Matlab with .Net.

    Cheers!

  20. thomas

    Please if you work for Mathworks release a version of MWArray which Target .NET framework 4.0. There should be a version for all .NET framework. Without this it is not posisble to run .NET 4.0 client calling into matlab generated asembly on Windows 7 64 bit simply because .NET framework 2.0 is not supported. When I target 4.0 inside matlab I expect ALL dependencies to be .NET Framework 4.0 !!!

    Thanks

  21. boris

    Hi

    I want to use some matlab functions in C#, i do all the steps above but every time that i run the program I obtain in this line code ” double [,] h=(double[,])Results.ToArray(); ” the next error:

    Could not load file or assembly ‘ManagedCPPAPI.netmodule’ or one of its dependencies. Error en una rutina de inicialización de biblioteca de vínculos dinámicos (DLL). (Exception from HRESULT: 0x8007045A)

    How do i resolve this.

  22. boris

    Hi

    I create a function in Matlab 2009a:
    J=seg(I,hs,hr,tol)
    Inputs:
    I: is a matrix
    hs , hr, tol: are parameters
    Outputs:
    J:is a matrix

    I follow the steps in your other post “Using Matlab functions in C# (2009 a)” to create the .dll

    Im workin in Visual Studio 2010. In my application in a specific button I put the following code:
    1-MWArray [] Results=new MWArray[1];
    2-Segmentation image= new segmentation();
    3-Results[0] = (MWArray[])image.seg(1,I,hs,hr,tol);

    At the beginning I was having in the line 3 the next problem:

    “Could not load file or assembly ‘MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”

    But I use the solution that you have here by adding gacutil /i MWarray.dll and now my new problem in the line 3 is:

    “Could not load file or assembly ‘ManagedCPPAPI.netmodule’ or one of its dependencies. Error en una rutina de inicialización de biblioteca de vínculos dinámicos (DLL). (Exception from HRESULT: 0x8007045A)”

    How do i resolve this.

  23. xinyustudio

    I suspect that some .net DLL is missing or could not be found by MWMCR. You might try search “ManagedCPPAPI.netmodule” to see where this file is located. If you are using x86 architecture, you can find it in the “bin\debug” folder of your VS project folder. If you are using in a x64 mode, you probably will not see it, at least, this is the case to my tests.

    To recap, you need to make sure the file “ManagedCPPAPI.netmodule” is put in the same folder where you binary exe is located.

    Good luck and happy coding!

  24. xinyustudio

    You should install the MCRInstaller.exe on the target machine, and then copy the dll and related exe, preferably into the same folder; or otherwise, make sure the related dll path are appended to the environment variable “path”. To recap, you need to make the binary exe know where to find the dependent dlls. Good luck.

    BTW: Boris, can you please share how you have troubleshot the problem above?

  25. boris

    In fact I dont know where was the problem when I used Matlab 2009a, I install the Matlab 2010b and then follow all the steps above explained and works fine.

  26. Héctor

    thanks you so much xinystudio, i’ve get to run simple functions of matlab in Visual Studio 2010 and plot it, now im searching for the component ZedGraph for paint my graph in the window app.
    Cheers!!

  27. swapna

    Hi xinyustudio,
    I have deployed my application on client PC.
    I am also getting the error as
    “.{“The type initializer for ‘MathWorks.MATLAB.NET.Utility.MWMCR’ threw an exception.”}, {“Trouble initializing libraries required by Builder NE.\n”}, ” at MathWorks.MATLAB.NET.Utility.MWMCR..cctor()”, or {“Trouble initializing libraries required by Builder NE.\n”}”
    But, I have installed MCR 7.11 properly and after that the PC is restarted. But, still this error is there. Can you please help urgently ???

  28. xinyustudio

    swapna, the info is far less enough for me to help. More info is expected to troubleshoot this, e.g. what os, what version of VS, x86 or x64 etc.

  29. boris

    Hi I find how to fix in other way my problem add this configuration to the app.config file. this should figure out the problem. I think that it is related to the version of the dll that was created with matlab

    Regards

  30. Maryam

    Hi, I have the same problem as “Christos75” is describing in this page. I`d really appreciate any help.
    I get an ‘MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” when I try to connect my matlab .Net assembly to C#. I change the configuration to x64. The error resolves. However, I get another error indication that one of the previous libraries developed initially in C# has the same problem: “‘DAL, Version=1.2.1.0, Culture=neutral, PublicKeyToken=…’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”

    Can you help me how to resolve this?

  31. xinyustudio

    Maryam, I think the reason might be: the DAL assembly you use is compiled in x86 configuration, so when you switch the project setting to x64, the DAL is not compatible with this setting any longer. One possible solution is to recompile your DAL solution in x64 mode, and reference the x64 version in your solution; of if you don’t have the source, you might have to try your program on a x86 (32 bit) OS. Happy coding and hope this helps!

  32. Maryam

    Many Thanks; That problem resolved. Actually I tried to create my Matlab MCR dll libraries with 32 bit matlab (on a 64 OS though). However, now I get another error. When I apply my .net libraries created in deploytool in a new project, everything`s fine and I have my expected outputs; but when I merge it into the main application solution, add them as references, and apply them for coding, then I receive this exception: “System.TypeInitializationException was unhandled Message: The type initializer for ‘com.SBD.SBDclass’ threw an exception.” SBDclass is the type that has been created with deploytool (Misrosoft Framework 3.5). Do you have any idea about this?
    I even tried creating a new project and referring to it in the main application solution; but I received the same error!

  33. xinyustudio

    As I don’t know where SBDclass is from, I cannot help. From your description, I am pretty sure that the problem is due to mixed config of x86/x64 config in your referenced assemblies. Given this hint, it is trivial to troubleshoot your problems.

  34. Divya

    Hi,
    I have deployed a Matlab .NET package and wrote a sample application in VS 2010 (64-bit). It builds successfully. But while running it throws an exception from

    at MathWorks.MATLAB.NET.Arrays.MWNumericArray.validateInput(Array realData, Array imaginaryData)
    at MathWorks.MATLAB.NET.Arrays.MWNumericArray.FastBuildNumericArray(Array realData, Array imaginaryData, Boolean makeDouble, Boolean rowMajorData)
    at MathWorks.MATLAB.NET.Arrays.MWNumericArray..ctor(Array realData, Array imaginaryData, Boolean makeDouble, Boolean rowMajorData)
    at MathWorks.MATLAB.NET.Arrays.MWNumericArray.op_Implicit(Array realData)
    at TestIntegration.Form1.buttonMagicSquare_Click(Object sender, EventArgs e) in K:\TestIntegration\TestIntegration\Form1.cs:line 46
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    ……”

    The code that causes the exception is

    private void buttonMagicSquare_Click(object sender, EventArgs e)
    {
    MWNumericArray input = null;
    MWNumericArray output = null;
    int inputarg = 1;

    MLTestClass obj = new MLTestClass();
    input = new MWNumericArray(5);

    output = obj.makesquare(1,input); /// Error comes from the second argument in this stmt,

    output = (MWNumericArray)output[0];

    MessageBox.Show(output.NumericType.ToString());

    }
    Can you help me in solving this problem?

    Thanks,
    Divya

  35. Divya

    The problem posted in the above comment has been solved. I think it was due to some incompatible settings parameter.
    Divya

  36. Jungwoo

    Hello, I’m searching my solution for problem. and than i find this site and you. I’coding C# with matlab compiler NE Tool. but My code has the error about mkl.dll. but my code is complete building and no error. i don’t know this situation. Details, when debugging and connecting to matlab functions in added class to making code, generate pop up windows about mkl.dll. and this pop up present “Can’t create the specifed module.” I’m so so sad… I’m crying soon. please help my problem. – See more at: http://www.geospecialling.com/index.php/2013/01/a-net-based-user-interface-for-matlab-applications/#sthash.riyaPhNm.dpuf

  37. sam

    Hi, thanks for the very interesting post. I am having trouble getting this to work in Azure.. Any ideas:

    I have compiled a MATLAB function using R2013a into a .NET dll using Builder NE.

    I can reference the dll and call the function successfully from a C# Console app.

    But the same code fails when running in a worker role through an Azure Cloud Service project. The application just crashes out silently and stops debugging at the line that initializes the class in the dll. There is this message in the Debug Output window:

    “The program ‘[8620] WaWorkerHost.exe: Managed (v4.0.30319)’ has exited with code -529697949 (0xe06d7363) ‘Microsoft C++ Exception’.”

    I have tried a couple of things in the project properties: Set the Platform target to x64; Unchecked ‘Enable the Visual Studio hosting process”

    It fails both running in the Azure Emulator on my dev machine, and when deployed to an Azure worker role on a Cloud Service. Yet when I execute a console app that calls the same dll via Process.Start it calls the MATLAB/MCR/.Net dll successfully. (I have a startup task that silently installs the MATLAB MCR)

    Thanks

  38. sam

    There’s no exception other than that line in the Debug Output window.

    It works in a console app, but not in the Azure emulator or in Azure proper. Ah well.. just thought I’d ask as your post was really good and hoped you might have tried it!

    Thanks

  39. Andreia

    Hi xinyustudio,

    I have compiled a MATLAB function using R2012b into a .NET dll using Builder NE.

    I can reference the dll and call the function successfully from a C# Console app.
    I already have include this namespace: MathWorks.MATLAB.NET.Arrays

    I can build too without errors (Visual Studio 2013), just with one warning
    “There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “MWArray, Version=2.12.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f, processorArchitecture=AMD64”, “AMD64″. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. MatLabTest”.

    But when i run my application test, it fails in this line:
    “MyFingerClass obj = new MyFringerClass()”
    the error is: “TypeInitializationException was unhandled”

    I follow yours steps and the steps from the site “http://domoreinlesstime.wordpress.com/2013/01/26/access-matlab-from-c/comment-page-1/#comment-8”, and also this one “http://internetexception.com/post/2013/01/20/Using-with-Matlab-from-C-sharp-application.aspx” to communicte with matlab.

    Can you solve it?

  40. Andreia

    I resolved the warning, i put everything in x64.
    But i have another error….

    When i execute the command:

    var activationContext = Type.GetTypeFromProgID(“matlab.application.single”);
    var matlab = (MLApp.MLApp)Activator.CreateInstance(activationContext);

    MyfingerClass obj = new MyfingerClass;
    Console.WriteLine(matlab.Execute(“tks=obj.demo_fingerprint()”))

    it says “undefined variable “obj” or class “obj.demo_fingerprint” “, where demo_fingerprint is a funtion, that i have geneated in MatLab, from class MyFingerClass

    Can tpu solve it?

  41. O.Hussain

    Hi xinyustudio,

    I tried it but it gives me this error:

    MissingMethodException: Method not found: ‘MathWorks.MATLAB.NET.Utility.MWMCR..ctor’.
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Mat_unity.Mat_unity
    testwith_matlab.Update ()

    also i put the dlls from dist folder in the Assets folder of my unity project.

  42. xinyustudio

    @o.Hussain, if you have looked through the post from the beginning to the end, you will find there is a solution to it. Specifically, go to (8) and then (2) to see how to troubleshoot this. Good luck.

  43. Meysam

    Hi xinyustudio,

    I have a simple function for sample but I have a error with this function! my error is:
    ————————-
    … MWMCR::EvaluateFunction error …
    Too many output arguments..
    ————————-

    my function in matlab file was:
    ————————-
    function [y]=foo(x)
    y=x^2;
    end
    ————————-

    and my code in C#.net is:
    ————————
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using foodll01;
    using MathWorks.MATLAB.NET.Arrays;
    using MathWorks.MATLAB.NET.Utility;

    namespace foo
    {
    class Program
    {
    static void Main(string[] args)
    {
    Class1 css1 = new Class1();
    MWNumericArray w = new MWNumericArray(new Int32());
    w = css1.foo(2); \\error in this line
    Console.WriteLine(w.ToString());
    Console.ReadKey();

    }
    }
    }
    ———————–

    TanX!

  44. Pingback: How To Fix 0x8007045a Networking Troubleshooting Errors - Windows Vista, Windows 7 & 8

  45. Tuan

    I have a old application build by C# and they use some .dll files (m2m_aoa.dll, m2m_ctoa.dll, MWArray) which built by Matlab. I assume it was build by 32bit system. They all reference path at ” project_name\bin\Debug\”. Now I run that application in new system with Matlab 2014a (64bit),Visual Studio 2013 and MCR_R2014a_win64_installer.

    1. First time, from Visual Studio, I run it in x86 platform, I got problem in line of code

    MWNumericArray mwMS = new MWNumericArray(MWArrayComplexity.Real, 2, 1);

    with error:

    Exception:Thrown: “The type initializer for ‘MathWorks.MATLAB.NET.Arrays.MWNumericArray’ threw an exception.” (System.TypeInitializationException)
    A System.TypeInitializationException was thrown: “The type initializer for ‘MathWorks.MATLAB.NET.Arrays.MWNumericArray’ threw an exception.”

    and they stuck in that line of code.

    2. I try to build in x64 platform with copy MWArray.dll from “dotnetbuilder\bin\win64\v2.0” into directory :

    bin\Debug\MWArray.dll

    I run again and they pass that line of code. But I got new error in another m2m_ctoa.dll file which use MWArray (this file also is built by Matlab) in this line of code:

    ctoa = new CTOA();

    with two errors

    Exception:Thrown: “Could not load file or assembly ‘MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” (System.BadImageFormatException)
    A System.BadImageFormatException was thrown: “Could not load file or assembly ‘MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”

    and

    Exception:Thrown: “The type initializer for ‘m2m_ctoa.CTOA’ threw an exception.” (System.TypeInitializationException)
    A System.TypeInitializationException was thrown: “The type initializer for ‘m2m_ctoa.CTOA’ threw an exception.”

    Then the application shutdown immediately if I do not try catch in this line of code.

    Please help me. I am so confuse.

    All errors happen with these .dll files. I feel VS can not read these files. Maybe they are empty but their space up to 88KB each.

    Could these old .dll files which build from 32bit platform able run in my system? If it could, how can I fix it?

    Are the location of these files normal? They are in directory ” project_name\bin\Debug\” and the reference paths are match.

    Do I have to compile these files from Matlab again? In this case, could I convert dll file to Matlab code?

    Please help me. Thank you very much in advance.

Leave a comment