Prepare Your Microsoft Visual Studio Environment
Before you begin writing your .NET client program using the MATLAB® Production Server™ .NET client library, complete the following steps to prepare your development environment.
Create Microsoft Visual Studio Project
Open Microsoft® Visual Studio®.
Click File > New > Project.
In the New Project dialog box, select the template you want to use. For example, if you want to create a C# console application in Visual Studio 2017, select Visual C# > Windows Desktop in the left navigation pane, then select the Console App (.Net Framework).
Type the name of the project in the Name field (for example,
Magic
).Click OK. Your
Magic
source shell is created, typically namedProgram.cs
, by default.
Add Reference to .NET Client Library
To use the classes and methods defined in the MATLAB Production Server .NET client library, create a reference to the library in your Microsoft Visual Studio project.
In the Solution Explorer pane within Microsoft Visual Studio (usually on the right side), right-click your
Magic
project, select Add > Browse.Browse to the MATLAB Production Server .NET client runtime library location.
In an on-premises MATLAB Production Server installation, the library is located in
, where$MPS_INSTALL
\client\dotnet
is the location in which MATLAB Production Server is installed. Select the$MPS_INSTALL
MathWorks.MATLAB.ProductionServer.Client.dll
file.The client library is also available for download at
https://www.mathworks.com/products/matlab-production-server/client-libraries.html
.Click OK. Your Microsoft Visual Studio project now references the
MathWorks.MATLAB.ProductionServer.Client.dll
.