Error while using MATLAB Builder generated dlls

1 view (last 30 days)
Hello, We had few custom programs in MATLAB which we wanted to use it in .NET framework. We did a POC using MATLAB Builder NE Toolbox of MATLAB version R2011a. We could successfully use those programs. Later we updated to the latest version of MATLAB (R2014a) and then using the MATLAB Builder NE Toolbox regenerated the DLL along with new MCR installation package. With the new dll's we are facing issue and unable to invoke the object Methods of the DLL. The error is "The type initializer for 'MathWorks.MATLAB.NET.Utility.MWMCR' threw an exception." and we are unable to proceed. Can anybody help? Madhukar.
  1 Comment
Madhukar
Madhukar on 30 Jun 2014
Thanks Tejas for the reply. We got some feedback from the MATHWORKS team on similar lines to that of yours and we were able to get the issue resolved. We need to have the correct version of MCR installed also, as the packaged MCR along with the BUILD Dll's isn't of the same size as that is downloaded from the Matworks website. Also the DLL's aren't signed dll's and you need to do a little workaround to get the DLL's signed. After all these tricks and workaround, we could get the appropriate working DLL's.

Sign in to comment.

Accepted Answer

Tejas M U
Tejas M U on 30 Jun 2014
The C# project that is using DLLs need to be of the same bitness as the DLL that you have. That is one of the reasons that you could be getting this problem. If you are using Visual Studio, then you can set the correct bitness by going to ‘Configuration Manager’ under the drop down ‘Debug’ menu, and choosing x86 or x64 based on the DLL that you are using.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!