Skip to Main Content Skip to Search
Product Documentation

The mcc Command Line

Command-Line Syntax Description

Instead of using the Deployment Tool to create .NET components, you can use the mcc command.

The following command defines the complete mcc command syntax with all required and optional arguments used to create a .NET component. Brackets indicate optional parts of the syntax.

mcc  - W 'dotnet:component_name,class_name, 0.0|framework_version, Private|Encryption_Key_Path,local|remote' file1 [file2...fileN][class{class_name:file1 [,file2,...,fileN]},... [-d output_dir_path] -T link:lib

.NET Bundle Files

You can simplify the command line used to create .NET components. To do so, use the .NET Builder bundle file, named dotnet. Using this bundle file still requires that you pass in the five parts (including local|remote) of the -W argument text string; however, you do not have to specify the -T option.

The following example creates a .NET component called mycomponent containing a single .NET class named myclass with methods foo and bar. When used with the -B option, the word dotnet specifies the name of the predefined .NET Builder bundle file.

mcc -B 'dotnet:mycomponent,myclass,2.0,
    encryption_keyfile_path,local'
    foo.m bar.m

In this example, the builder uses the .NET Framework version 2.0 to compile the component into a shared assembly using the key file specified in encryption_keyfile_path to sign the shared component.

See Supported Microsoft .NET Framework Versions for a list of supported framework versions.

Creating a .NET Component Namespace

The following example creates a .NET component from two MATLAB files foo.m and bar.m.

mcc  -B 
'dotnet:mycompany.mygroup.mycomponent,myclass,0.0,Private,local'
 foo.m bar.m

The example creates a .NET component named mycomponent that has the following namespace: mycompany.mygroup. The component contains a single .NET class, myclass, which contains methods foo and bar.

To use myclass, place the following statement in your code:

using mycompany.mygroup;

See Supported Microsoft .NET Framework Versions for a list of supported framework versions.

Adding Multiple Classes to a Component

The following example creates a .NET component that includes more than one class. This example uses the optional class{...} argument to the mcc command.

mcc  -B 'dotnet:mycompany.mycomponent,myclass,2.0,Private,local' foo.m bar.m 
class{myclass2:foo2.m,bar2.m}

The example creates a .NET component named mycomponent with two classes:

See Supported Microsoft .NET Framework Versions for a list of supported framework versions.

Using the Deployment Tool GUI from the Command Line

Desired ResultsCommand
Start Deployment Tool GUI with the New/Open dialog box activedeploytool (default)
or
deploytool -n
 
 
Start Deployment Tool GUI and load project_namedeploytool project_name.prj 
 
Start Deployment Tool command line interface and build project_name after initializingdeploytool -win32 -build project_name.prj 
Start Deployment Tool command line interface and package project_name after initializingdeploytool -package project_name.prj 
Start Deployment Tool and package an existing project from the Command Line Interface. Specifying the package_name is optional. By default, a project is packaged into a .zip file. On Windows, if the package_name ends with .exe, the project is packaged into a self-extracting .exe. deploytool -package project_name.prj package_name 
Display MATLAB Help for the deploytool commanddeploytool -? 

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS