| Contents | Index |
| On this page… |
|---|
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
Note For complete information about the mcc command, including the -W option, see mcc in the function reference section of this User's Guide. To learn more about the mcc command and all of its options, see the MATLAB Compiler documentation. |
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.
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.
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:
myclass has methods foo and bar
myclass2 has methods foo2 and bar2
See Supported Microsoft .NET Framework Versions for a list of supported framework versions.
![]() | The Deployment Tool GUI | Examples | ![]() |

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 |