Main Content


Make .NET assembly visible to MATLAB



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

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


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.


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


  • 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