Main Content

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

  1. Open Microsoft® Visual Studio®.

  2. Click File > New > Project.

  3. 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).

  4. Type the name of the project in the Name field (for example, Magic).

  5. Click OK. Your Magic source shell is created, typically named Program.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.

  1. In the Solution Explorer pane within Microsoft Visual Studio (usually on the right side), right-click your Magic project, select Add > Browse.

  2. Browse to the MATLAB Production Server .NET client runtime library location.

    In an on-premises MATLAB Production Server installation, the library is located in $MPS_INSTALL\client\dotnet, where $MPS_INSTALL is the location in which MATLAB Production Server is installed. Select the 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.

  3. Click OK. Your Microsoft Visual Studio project now references the MathWorks.MATLAB.ProductionServer.Client.dll.

Related Topics