Creates a .NET object, that is, a ColdFusion proxy for accessing a class in a local or remote .NET assembly.


class="class name" 
name="instance name" 
assembly="absolute path" 
server = "localhost">


You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.

Using NTLM attributes


The ntlmDomain is required when authType=NTLM.

When a user is part of a domain, the ntlmDomain attribute is mandatory. When a user is not part of a domain, the ntlmDomain attribute is not mandatory.

See also

.NET objectDotNetToCFTypeUsing Microsoft .NET Assemblies in the Developing ColdFusion Applications


Adobe ColdFusion (2016 release): Added NTLM attributes.

ColdFusion 8: Added .NET and dotnet type values, and the assembly, port, protocol, and secure attributes.









Name of the .NET class to instantiate as an object.




String; reference name of the component to use in your application.


Required for .NET


Object type. Must be .NET or dotnet for .NET objects.




Action to take. Must be create.



mscorlib.dll which contains the .NET core classes.

For local .NET assemblies, the absolute path or paths to the assembly or assemblies (EXE or DLL files) from which to access the .NET class and its supporting classes. If a class in an assembly requires supporting classes that are in other assemblies, you must also specify those assemblies. You can, however, omit the supporting assemblies for the following types of supporting classes:

  • .NET core classes (classes in mscorlib.dll)
  • Classes in assemblies that are in the global assembly cache (GAC)
    To specify multiple assemblies, use a comma-delimited list.For remote .NET assemblies, you must specify the absolute path or paths of the local proxy JAR file or files that represent the assemblies.
    If you omit this attribute, and there is no local .NET installation, the tag fails without generating an error. If you omit this attribute, there is a local .NET installation, and the specified class is not in the .NET core classes, ColdFusion generates an error.




Port number at which the .NET-side agent is listening.




Protocol to use for communication between ColdFusion and .NET. Must be one of the following values:

  • http: Use HTTP/SOAP communication protocol. This option is slower than tcp, but might be required for access through a firewall.
  • tcp: Use binary TCP/IP protocol. This method is more efficient than HTTP.




Whether to secure communications with the .NET-side agent. If true, ColdFusion uses SSL to communicate with .NET.




Host name or IP address of the server where the .NET-side agent is running. Can be in any of these forms:

  • server name (for example, myserver)
  • IP address (for example,
    You must specify this attribute to access .NET components on a remote server.


The cfobject tag with a .NET or dotnet value for the type attribute creates a reference to a .NET object of a given class. Using the reference, you can access the .NET object's fields and methods. The .NET classes do not have to be local, and you can use the cfobject tag on a system that does not have .NET installed, including UNIX-based or OS-X systems.
To access .NET assemblies, do the following:

  • Install the ColdFusion .NET Extension and run the .NET extension service on the system on which the assemblies are installed. You do not have to install the extension or run the extension service on a ColdFusion system that accesses only remote assemblies. For installation instructions, see Installing and Using ColdFusion.
  • If the assemblies are located on a remote system, create Java proxies for the .NET classes that you use, copy the proxies to the ColdFusion system, and configure the remote system for access by the proxies. For information on these steps, see Using Microsoft .NET Assemblies in the Developing ColdFusion Applications. If the .NET assemblies are on your ColdFusion system, you do not have to perform these steps.
    Accessing methods and fieldsYou call .NET methods as you use any other ColdFusion object methods. In the simplest case, your application code uses the following format to call a .NET class method:

<cfobject type=".NET" name="mathInstance" class="mathClass"> 
<cfset myVar=mathInstance.multiply(1,2)>

If a .NET class has multiple constructors, and you do not want ColdFusion to use the default constructor to create the object, invoke a specific constructor by calling the special init method of the ColdFusion object with the constructor's arguments. For example, you can use the following tags to instantiate, int):

<cfobject type=".NET" class="" 
assembly="c:\temp\myLib.dll" name="myObj" > 
<cfset myObj.init(10, 5)>

You access and change .NET class public fields by calling the following methods:


For example, if the .NET class has a public field named account, you can access and modify its value by using Get_acount() and Set_account() methods, respectively.

You can access, but not modify final fields, so you can only call Get_fieldName() for these fields.


The following example uses the GetProcess method of the .NET System.Diagnostics.Process class to get and display information about the processes running on the local system. Because it uses a core .NET class, for which ColdFusion automatically generates proxies, you do not have to specify an assembly name in the cfobject tag. For more complex examples, including examples that use custom .NET classes, see Using Microsoft .NET Assemblies in the Developing ColdFusion Applications.

<cfobject type=".NET" name="proc" class="System.Diagnostics.Process"> 
<cfset processes = proc.GetProcesses()> 
<cfset arrLen = arrayLen(processes)> 

<table border=0 cellspacing="3" cellpadding="3"> 
<tr bgcolor="#33CCCC"> 
<td style="font-size:12px; font-weight:bold" nowrap>Process ID</td> 
<td style="font-size:12px; font-weight:bold" nowrap>Name</td> 
<td style="font-size:12px; font-weight:bold" nowrap>Memory (KB)</td> 
<td style="font-size:12px; font-weight:bold" nowrap>Peak Memory (KB)</td> 
<td style="font-size:12px; font-weight:bold" nowrap>Virtual Memory Size (KB)</td> 
<td style="font-size:12px; font-weight:bold" nowrap>Start Time</td> 
<td style="font-size:12px; font-weight:bold" nowrap>Total Processor Time</td> 
<cfloop from = 1 to="#arrLen#" index=i> 
<cfset process = processes[i]> 
<cfset id = process.Get_Id()> 
<cfif id neq 0> 
<td align="right">#process.Get_Id()#</td> 
<td align="right">#process.Get_PagedMemorySize()/1000#</td> 
<td align="right">#process.Get_PeakPagedMemorySize()/1000#</td> 
<td align="right">#process.Get_VirtualMemorySize()/1000#</td> 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy