Export (0) Print
Expand All

ConstructorBuilder Class

Defines and represents a constructor of a dynamic class.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

[ClassInterfaceAttribute(ClassInterfaceType.None)]
[ComVisibleAttribute(true)]
[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public sealed class ConstructorBuilder : ConstructorInfo, 
	_ConstructorBuilder

The ConstructorBuilder type exposes the following members.

  NameDescription
Public propertyAttributesRetrieves the attributes for this constructor. (Overrides MethodBase.Attributes.)
Public propertyCallingConventionGets a CallingConventions value that depends on whether the declaring type is generic. (Overrides MethodBase.CallingConvention.)
Public propertyContainsGenericParametersGets a value indicating whether the generic method contains unassigned generic type parameters. (Inherited from MethodBase.)
Public propertyCustomAttributesGets a collection that contains this member's custom attributes. (Inherited from MemberInfo.)
Public propertyDeclaringTypeRetrieves a reference to the Type object for the type that declares this member. (Overrides MemberInfo.DeclaringType.)
Public propertyInitLocalsGets or sets whether the local variables in this constructor should be zero-initialized.
Public propertyIsAbstractGets a value indicating whether the method is abstract. (Inherited from MethodBase.)
Public propertyIsAssemblyGets a value indicating whether the potential visibility of this method or constructor is described by MethodAttributes.Assembly; that is, the method or constructor is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly. (Inherited from MethodBase.)
Public propertyIsConstructorGets a value indicating whether the method is a constructor. (Inherited from MethodBase.)
Public propertyIsFamilyGets a value indicating whether the visibility of this method or constructor is described by MethodAttributes.Family; that is, the method or constructor is visible only within its class and derived classes. (Inherited from MethodBase.)
Public propertyIsFamilyAndAssemblyGets a value indicating whether the visibility of this method or constructor is described by MethodAttributes.FamANDAssem; that is, the method or constructor can be called by derived classes, but only if they are in the same assembly. (Inherited from MethodBase.)
Public propertyIsFamilyOrAssemblyGets a value indicating whether the potential visibility of this method or constructor is described by MethodAttributes.FamORAssem; that is, the method or constructor can be called by derived classes wherever they are, and by classes in the same assembly. (Inherited from MethodBase.)
Public propertyIsFinalGets a value indicating whether this method is final. (Inherited from MethodBase.)
Public propertyIsGenericMethodGets a value indicating whether the method is generic. (Inherited from MethodBase.)
Public propertyIsGenericMethodDefinitionGets a value indicating whether the method is a generic method definition. (Inherited from MethodBase.)
Public propertyIsHideBySigGets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class. (Inherited from MethodBase.)
Public propertyIsPrivateGets a value indicating whether this member is private. (Inherited from MethodBase.)
Public propertyIsPublicGets a value indicating whether this is a public method. (Inherited from MethodBase.)
Public propertyIsSecurityCriticalGets a value that indicates whether the current method or constructor is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations. (Inherited from MethodBase.)
Public propertyIsSecuritySafeCriticalGets a value that indicates whether the current method or constructor is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code. (Inherited from MethodBase.)
Public propertyIsSecurityTransparentGets a value that indicates whether the current method or constructor is transparent at the current trust level, and therefore cannot perform critical operations. (Inherited from MethodBase.)
Public propertyIsSpecialNameGets a value indicating whether this method has a special name. (Inherited from MethodBase.)
Public propertyIsStaticGets a value indicating whether the method is static. (Inherited from MethodBase.)
Public propertyIsVirtualGets a value indicating whether the method is virtual. (Inherited from MethodBase.)
Public propertyMemberTypeGets a MemberTypes value indicating that this member is a constructor. (Inherited from ConstructorInfo.)
Public propertyMetadataTokenGets a value that identifies a metadata element. (Inherited from MemberInfo.)
Public propertyMethodHandleRetrieves the internal handle for the method. Use this handle to access the underlying metadata handle. (Overrides MethodBase.MethodHandle.)
Public propertyMethodImplementationFlagsGets the MethodImplAttributes flags that specify the attributes of a method implementation. (Inherited from MethodBase.)
Public propertyModuleGets the dynamic module in which this constructor is defined. (Overrides MemberInfo.Module.)
Public propertyNameRetrieves the name of this constructor. (Overrides MemberInfo.Name.)
Public propertyReflectedTypeHolds a reference to the Type object from which this object was obtained. (Overrides MemberInfo.ReflectedType.)
Public propertyReturnType Obsolete. Gets null.
Public propertySignatureRetrieves the signature of the field in the form of a string.
Top

  NameDescription
Public methodAddDeclarativeSecurityAdds declarative security to this constructor.
Public methodDefineParameterDefines a parameter of this constructor.
Public methodEqualsReturns a value that indicates whether this instance is equal to a specified object. (Inherited from ConstructorInfo.)
Public methodGetCustomAttributes(Boolean)Returns all the custom attributes defined for this constructor. (Overrides MemberInfo.GetCustomAttributes(Boolean).)
Public methodGetCustomAttributes(Type, Boolean)Returns the custom attributes identified by the given type. (Overrides MemberInfo.GetCustomAttributes(Type, Boolean).)
Public methodGetCustomAttributesDataReturns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member. (Inherited from MemberInfo.)
Public methodGetGenericArgumentsReturns an array of Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition. (Inherited from MethodBase.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from ConstructorInfo.)
Public methodGetILGenerator()Gets an ILGenerator for this constructor.
Public methodGetILGenerator(Int32)Gets an ILGenerator object, with the specified MSIL stream size, that can be used to build a method body for this constructor.
Public methodGetMethodBodyWhen overridden in a derived class, gets a MethodBody object that provides access to the MSIL stream, local variables, and exceptions for the current method. (Inherited from MethodBase.)
Public methodGetMethodImplementationFlagsReturns the method implementation flags for this constructor. (Overrides MethodBase.GetMethodImplementationFlags().)
Public methodGetModuleReturns a reference to the module that contains this constructor.
Public methodGetParametersReturns the parameters of this constructor. (Overrides MethodBase.GetParameters().)
Public methodGetTokenReturns the MethodToken that represents the token for this constructor.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInvoke(Object[])Invokes the constructor reflected by the instance that has the specified parameters, providing default values for the parameters not commonly used. (Inherited from ConstructorInfo.)
Public methodInvoke(Object, Object[])Invokes the method or constructor represented by the current instance, using the specified parameters. (Inherited from MethodBase.)
Public methodInvoke(BindingFlags, Binder, Object[], CultureInfo)Invokes the constructor dynamically reflected by this instance on the given object, passing along the specified parameters, and under the constraints of the given binder. (Overrides ConstructorInfo.Invoke(BindingFlags, Binder, Object[], CultureInfo).)
Public methodInvoke(Object, BindingFlags, Binder, Object[], CultureInfo)Dynamically invokes the constructor reflected by this instance with the specified arguments, under the constraints of the specified Binder. (Overrides MethodBase.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo).)
Public methodIsDefinedChecks if the specified custom attribute type is defined. (Overrides MemberInfo.IsDefined(Type, Boolean).)
Public methodSetCustomAttribute(CustomAttributeBuilder)Set a custom attribute using a custom attribute builder.
Public methodSetCustomAttribute(ConstructorInfo, Byte[])Set a custom attribute using a specified custom attribute blob.
Public methodSetImplementationFlagsSets the method implementation flags for this constructor.
Public methodSetMethodBodyCreates the body of the constructor by using a specified byte array of Microsoft intermediate language (MSIL) instructions.
Public methodSetSymCustomAttributeSets this constructor's custom attribute associated with symbolic information.
Public methodToStringReturns this ConstructorBuilder instance as a String. (Overrides Object.ToString().)
Top

  NameDescription
Public Extension MethodGetCustomAttribute(Type)Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttribute(Type, Boolean)Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttribute<T>()Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttribute<T>(Boolean)Overloaded. Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttributes()Overloaded. Retrieves a collection of custom attributes that are applied to a specified member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttributes(Type)Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttributes<T>()Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified member. (Defined by CustomAttributeExtensions.)
Public Extension MethodGetCustomAttributes<T>(Boolean)Overloaded. Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member. (Defined by CustomAttributeExtensions.)
Public Extension MethodIsDefinedIndicates whether custom attributes of a specified type are applied to a specified member. (Defined by CustomAttributeExtensions.)
Top

  NameDescription
Explicit interface implemetationPrivate method_ConstructorBuilder.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers.
Explicit interface implemetationPrivate method_ConstructorBuilder.GetTypeInfoRetrieves the type information for an object, which can then be used to get the type information for an interface.
Explicit interface implemetationPrivate method_ConstructorBuilder.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1).
Explicit interface implemetationPrivate method_ConstructorBuilder.InvokeProvides access to properties and methods exposed by an object.
Explicit interface implemetationPrivate method_ConstructorInfo.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.GetTypeGets a Type object representing the ConstructorInfo type. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.GetTypeInfoRetrieves the type information for an object, which can then be used to get the type information for an interface. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.InvokeProvides access to properties and methods exposed by an object. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.Invoke_2Provides COM objects with version-independent access to the MethodBase.Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) method. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.Invoke_3Provides COM objects with version-independent access to the MethodBase.Invoke(Object, Object[]) method. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.Invoke_4Provides COM objects with version-independent access to the ConstructorInfo.Invoke(BindingFlags, Binder, Object[], CultureInfo) method. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_ConstructorInfo.Invoke_5Provides COM objects with version-independent access to the ConstructorInfo.Invoke(Object[]) method. (Inherited from ConstructorInfo.)
Explicit interface implemetationPrivate method_MemberInfo.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers. (Inherited from MemberInfo.)
Explicit interface implemetationPrivate method_MemberInfo.GetTypeGets a Type object representing the MemberInfo class. (Inherited from MemberInfo.)
Explicit interface implemetationPrivate method_MemberInfo.GetTypeInfoRetrieves the type information for an object, which can then be used to get the type information for an interface. (Inherited from MemberInfo.)
Explicit interface implemetationPrivate method_MemberInfo.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from MemberInfo.)
Explicit interface implemetationPrivate method_MemberInfo.InvokeProvides access to properties and methods exposed by an object. (Inherited from MemberInfo.)
Explicit interface implemetationPrivate method_MethodBase.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers. (Inherited from MethodBase.)
Explicit interface implemetationPrivate method_MethodBase.GetTypeFor a description of this member, see _MethodBase.GetType. (Inherited from MethodBase.)
Explicit interface implemetationPrivate method_MethodBase.GetTypeInfoRetrieves the type information for an object, which can then be used to get the type information for an interface. (Inherited from MethodBase.)
Explicit interface implemetationPrivate method_MethodBase.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from MethodBase.)
Explicit interface implemetationPrivate method_MethodBase.InvokeProvides access to properties and methods exposed by an object. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsAbstractFor a description of this member, see _MethodBase.IsAbstract. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsAssemblyFor a description of this member, see _MethodBase.IsAssembly. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsConstructorFor a description of this member, see _MethodBase.IsConstructor. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsFamilyFor a description of this member, see _MethodBase.IsFamily. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsFamilyAndAssemblyFor a description of this member, see _MethodBase.IsFamilyAndAssembly. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsFamilyOrAssemblyFor a description of this member, see _MethodBase.IsFamilyOrAssembly. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsFinalFor a description of this member, see _MethodBase.IsFinal. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsHideBySigFor a description of this member, see _MethodBase.IsHideBySig. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsPrivateFor a description of this member, see _MethodBase.IsPrivate. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsPublicFor a description of this member, see _MethodBase.IsPublic. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsSpecialNameFor a description of this member, see _MethodBase.IsSpecialName. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsStaticFor a description of this member, see _MethodBase.IsStatic. (Inherited from MethodBase.)
Explicit interface implemetationPrivate property_MethodBase.IsVirtualFor a description of this member, see _MethodBase.IsVirtual. (Inherited from MethodBase.)
Top

ConstructorBuilder is used to fully describe a constructor in Microsoft intermediate language (MSIL), including the name, attributes, signature, and constructor body. It is used in conjunction with the TypeBuilder class to create classes at run time. Call DefineConstructor to get an instance of ConstructorBuilder.

If you do not define a constructor for your dynamic type, a default constructor is provided automatically, and it calls the default constructor of the base class.

If you use ConstructorBuilder to define a constructor for your dynamic type, a default constructor is not provided. You have the following options for providing a default constructor in addition to the constructor you defined:

  • If you want a default constructor that simply calls the default constructor of the base class, you can use the TypeBuilder.DefineDefaultConstructor method to create one (and optionally restrict access to it). Do not provide an implementation for this default constructor. If you do, an exception is thrown when you try to use the constructor. No exception is thrown when the TypeBuilder.CreateType method is called.

  • If you want a default constructor that does something more than simply calling the default constructor of the base class, or that calls another constructor of the base class, or that does something else entirely, you must use the TypeBuilder.DefineConstructor method to create a ConstructorBuilder, and provide your own implementation.

NoteNote

The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

The following code sample illustrates the contextual usage of a ConstructorBuilder.


using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

class TestCtorBuilder {

  	public static Type DynamicPointTypeGen() {
	  
	   Type pointType = null;
	   Type[] ctorParams = new Type[] {typeof(int),
					    typeof(int),
					    typeof(int)};
 	
	   AppDomain myDomain = Thread.GetDomain();
	   AssemblyName myAsmName = new AssemblyName();
	   myAsmName.Name = "MyDynamicAssembly";
	
	   AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(
					  myAsmName, 
					  AssemblyBuilderAccess.RunAndSave);

   	   ModuleBuilder pointModule = myAsmBuilder.DefineDynamicModule("PointModule",
									"Point.dll");

	   TypeBuilder pointTypeBld = pointModule.DefineType("Point",
						              TypeAttributes.Public);

	   FieldBuilder xField = pointTypeBld.DefineField("x", typeof(int),
                                                          FieldAttributes.Public);
	   FieldBuilder yField = pointTypeBld.DefineField("y", typeof(int), 
                                                          FieldAttributes.Public);
	   FieldBuilder zField = pointTypeBld.DefineField("z", typeof(int),
                                                          FieldAttributes.Public);


           Type objType = Type.GetType("System.Object"); 
           ConstructorInfo objCtor = objType.GetConstructor(new Type[0]);

	   ConstructorBuilder pointCtor = pointTypeBld.DefineConstructor(
					  MethodAttributes.Public,
					  CallingConventions.Standard,
					  ctorParams);
	   ILGenerator ctorIL = pointCtor.GetILGenerator();

	   // NOTE: ldarg.0 holds the "this" reference - ldarg.1, ldarg.2, and ldarg.3
	   // hold the actual passed parameters. ldarg.0 is used by instance methods 
	   // to hold a reference to the current calling object instance. Static methods 
	   // do not use arg.0, since they are not instantiated and hence no reference 
	   // is needed to distinguish them. 

           ctorIL.Emit(OpCodes.Ldarg_0);

	   // Here, we wish to create an instance of System.Object by invoking its 
  	   // constructor, as specified above.

           ctorIL.Emit(OpCodes.Call, objCtor);

	   // Now, we'll load the current instance ref in arg 0, along 
	   // with the value of parameter "x" stored in arg 1, into stfld.

           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_1);
           ctorIL.Emit(OpCodes.Stfld, xField); 

	   // Now, we store arg 2 "y" in the current instance with stfld.

           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_2);
           ctorIL.Emit(OpCodes.Stfld, yField); 

	   // Last of all, arg 3 "z" gets stored in the current instance.

           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_3);
           ctorIL.Emit(OpCodes.Stfld, zField); 

           // Our work complete, we return.

	   ctorIL.Emit(OpCodes.Ret); 

	   // Now, let's create three very simple methods so we can see our fields. 

	   string[] mthdNames = new string[] {"GetX", "GetY", "GetZ"}; 

           foreach (string mthdName in mthdNames) {
              MethodBuilder getFieldMthd = pointTypeBld.DefineMethod(
				           mthdName, 
				           MethodAttributes.Public,
                                           typeof(int), 
                                           null);
	      ILGenerator mthdIL = getFieldMthd.GetILGenerator();
	   
	      mthdIL.Emit(OpCodes.Ldarg_0);
  	      switch (mthdName) {
	         case "GetX": mthdIL.Emit(OpCodes.Ldfld, xField);
			      break;
	         case "GetY": mthdIL.Emit(OpCodes.Ldfld, yField);
			      break;
	         case "GetZ": mthdIL.Emit(OpCodes.Ldfld, zField);
			      break;

	      }
	      mthdIL.Emit(OpCodes.Ret);

           }
	   // Finally, we create the type.

 	   pointType = pointTypeBld.CreateType();

	   // Let's save it, just for posterity.
	   
	   myAsmBuilder.Save("Point.dll");
	
	   return pointType;

 	}

	public static void Main() {
	
	   Type myDynamicType = null;
           object aPoint = null;
	   Type[] aPtypes = new Type[] {typeof(int), typeof(int), typeof(int)};
           object[] aPargs = new object[] {4, 5, 6};
	
	   // Call the  method to build our dynamic class.

	   myDynamicType = DynamicPointTypeGen();

	   Console.WriteLine("Some information about my new Type '{0}':",
			      myDynamicType.FullName);
	   Console.WriteLine("Assembly: '{0}'", myDynamicType.Assembly);
	   Console.WriteLine("Attributes: '{0}'", myDynamicType.Attributes);
	   Console.WriteLine("Module: '{0}'", myDynamicType.Module);
	   Console.WriteLine("Members: "); 
	   foreach (MemberInfo member in myDynamicType.GetMembers()) {
		Console.WriteLine("-- {0} {1};", member.MemberType, member.Name);
	   }

           Console.WriteLine("---");

	   // Let's take a look at the constructor we created.

	   ConstructorInfo myDTctor = myDynamicType.GetConstructor(aPtypes);
           Console.WriteLine("Constructor: {0};", myDTctor.ToString());

           Console.WriteLine("---");
	  
           // Now, we get to use our dynamically-created class by invoking the constructor. 

	   aPoint = myDTctor.Invoke(aPargs);
           Console.WriteLine("aPoint is type {0}.", aPoint.GetType());
	   	   

	   // Finally, let's reflect on the instance of our new type - aPoint - and 
	   // make sure everything proceeded according to plan.

	   Console.WriteLine("aPoint.x = {0}",
			     myDynamicType.InvokeMember("GetX",
						        BindingFlags.InvokeMethod,
							null,
							aPoint,
							new object[0]));
	   Console.WriteLine("aPoint.y = {0}",
			     myDynamicType.InvokeMember("GetY",
						        BindingFlags.InvokeMethod,
							null,
							aPoint,
							new object[0]));
	   Console.WriteLine("aPoint.z = {0}",
			     myDynamicType.InvokeMember("GetZ",
						        BindingFlags.InvokeMethod,
							null,
							aPoint,
							new object[0]));

	    

	   // +++ OUTPUT +++ 
	   // Some information about my new Type 'Point': 
	   // Assembly: 'MyDynamicAssembly, Version=0.0.0.0' 
	   // Attributes: 'AutoLayout, AnsiClass, NotPublic, Public' 
	   // Module: 'PointModule' 
	   // Members:  
	   // -- Field x; 
	   // -- Field y; 
	   // -- Field z; 
           // -- Method GetHashCode; 
           // -- Method Equals; 
           // -- Method ToString; 
           // -- Method GetType; 
           // -- Constructor .ctor; 
	   // --- 
	   // Constructor: Void .ctor(Int32, Int32, Int32); 
	   // --- 
	   // aPoint is type Point. 
	   // aPoint.x = 4 
	   // aPoint.y = 5 
	   // aPoint.z = 6
	    
	}

}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft