Why am I getting the error "The type or namespace 'MLApp' could not be found" when building C# application using MATLAB?

3 views (last 30 days)
I am trying to connect to the MATLAB Application COM interface from my C# project and when I try to build it I get the error "The type or namespace 'MLApp' could not be found". How do I add this missing reference?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Dec 2020
To resolve this, you will need to add MATLAB Application as a COM reference in your C# project.
  1. First, make sure MATLAB is registered as a COM Automation server.
    • It can be registered by executing 'regmatlabserver' in the MATLAB Command Window.
  2. Add a reference to the MATLAB Application COM object in your C# project. Please follow the below steps for accomplishing this in Visual Studio.
    • From the Project menu, select Add Reference.
    • Select the COM tab in the Add Reference dialog box.
    • Select the MATLAB application.

More Answers (0)

Categories

Find more on MATLAB Compiler SDK in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!