Main Content

NET.addAssembly

Make .NET assembly visible to MATLAB

Description

asmInfo = NET.addAssembly(globalName) loads a global .NET assembly into MATLAB®.

example

asmInfo = NET.addAssembly(privateName) loads a private .NET assembly.

Examples

collapse all

Call the System.Windows.Forms.MessageBox.Show method in the global assembly System.Windows.Forms.

asm = NET.addAssembly('System.Windows.Forms');
import System.Windows.Forms.*
MessageBox.Show('Simple Message Box')

Input Arguments

collapse all

Global assembly name, specified as a string, character vector, or System.Reflection.AssemblyName object.

Private assembly name including the full path, specified as a string or a character vector.

Output Arguments

collapse all

Assembly information containing names of the members of the assembly, returned as a NET.Assembly object.

Limitations

  • NET.addAssembly does not support assemblies generated by the MATLAB Compiler SDK™ product.

Tips

  • With the Microsoft® .NET Framework, you do not need to call NET.addAssembly to access classes in the mscorlib.dll and system.dll assemblies. MATLAB dynamically loads these assemblies from the .NET class library the first time you type "NET." or "System.".

  • Refer to your .NET product documentation for the name of the assembly and its deployment type (global or private).

Version History

Introduced in R2009a