Activator.CreateInstanceFrom 메서드

정의

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

오버로드

CreateInstanceFrom(AppDomain, String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)
사용되지 않음.

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 지정된 원격 도메인에 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)
사용되지 않음.

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(AppDomain, String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 지정된 원격 도메인에 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(String, String, Object[])

명명된 어셈블리 파일 및 매개 변수가 없는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(AppDomain, String, String)

명명된 어셈블리 파일 및 매개 변수가 없는 생성자를 사용하여 지정된 원격 도메인에 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(String, String)

명명된 어셈블리 파일 및 매개 변수가 없는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

CreateInstanceFrom(AppDomain, String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

주의

Methods which use Evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 지정된 원격 도메인에 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(AppDomain ^ domain, System::String ^ assemblyFile, System::String ^ typeName, bool ignoreCase, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes, System::Security::Policy::Evidence ^ securityAttributes);
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityAttributes);
[System.Obsolete("Methods which use Evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
[System.Security.SecurityCritical]
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityAttributes);
static member CreateInstanceFrom : AppDomain * string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] * System.Security.Policy.Evidence -> System.Runtime.Remoting.ObjectHandle
[<System.Obsolete("Methods which use Evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
[<System.Security.SecurityCritical>]
static member CreateInstanceFrom : AppDomain * string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] * System.Security.Policy.Evidence -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (domain As AppDomain, assemblyFile As String, typeName As String, ignoreCase As Boolean, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object(), securityAttributes As Evidence) As ObjectHandle

매개 변수

domain
AppDomain

typeName이라는 형식이 만들어지는 원격 도메인입니다.

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

ignoreCase
Boolean

typeName에 대한 검색에서 대/소문자를 구분하지 않도록 지정하려면 true이고, 대/소문자를 구분하도록 지정하려면 false입니다.

bindingAttr
BindingFlags

typeName 생성자 검색에 영향을 미치는 0 또는 그 이상의 비트 플래그 조합입니다. bindingAttr가 0이면 대/소문자를 구분한 public 생성자 검색이 수행됩니다.

binder
Binder

bindingAttrargs을(를) 사용하여 typeName 생성자를 식별하고 검색하는 개체입니다. bindernull이면 기본 바인더가 사용됩니다.

args
Object[]

호출할 생성자의 매개 변수와 수, 순서 및 유형 면에서 일치하는 인수의 배열입니다. args이(가) 빈 배열이거나 null이면 매개 변수를 사용하지 않는 생성자(매개 변수가 없는 생성자)가 호출됩니다.

culture
CultureInfo

typeName 생성자에 대해 선언된 공식적인 형식에 args를 강제로 적용하는 것을 제어하는 문화권별 정보입니다. culturenull이면 현재 스레드의 CultureInfo가 사용됩니다.

activationAttributes
Object[]

활성화할 수 있는 하나 이상의 특성으로 이루어진 배열입니다. 일반적으로 원격 개체를 활성화 하는 데 필요한 URL을 지정하는 단일 UrlAttribute 개체가 포함된 배열입니다.

이 매개 변수는 클라이언트 활성 개체와 관련되어 있습니다. 클라이언트 활성화는 이전 버전과의 호환성을 위해 유지되지만 새로운 개발에는 권장되지 않는 레거시 기술입니다. 분산된 애플리케이션은 Windows Communication Foundation을 사용해야 합니다.

securityAttributes
Evidence

보안 정책을 결정하고 코드 권한을 부여하는 데 사용되는 정보입니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

특성

예외

domain 또는 typeNamenull인 경우

일치하는 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

호출자에게 필요한 FileIOPermission이 있는 경우

activationAttributes가 빈 배열이 아니므로 생성될 형식이 MarshalByRefObject에서 파생되지 않습니다.

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

CLR(공용 언어 런타임) 버전 2.0 이상이 현재 로드되었는데 현재 로드된 버전보다 최신 버전인 CLR에 대해 assemblyName이 컴파일되었습니다. .NET Framework 버전 2.0, 3.0 및 3.5는 모두 CLR 버전 2.0을 사용합니다.

설명

사용 하 여 CreateInstanceFrom 호스트 제한 된 보안 권한을 가진 애플리케이션 도메인에서 코드를 실행 해야 할 경우.

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[], Evidence)

주의

Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName, bool ignoreCase, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes, System::Security::Policy::Evidence ^ securityInfo);
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityInfo);
[System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityInfo);
static member CreateInstanceFrom : string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] * System.Security.Policy.Evidence -> System.Runtime.Remoting.ObjectHandle
[<System.Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")>]
static member CreateInstanceFrom : string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] * System.Security.Policy.Evidence -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (assemblyFile As String, typeName As String, ignoreCase As Boolean, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object(), securityInfo As Evidence) As ObjectHandle

매개 변수

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

ignoreCase
Boolean

typeName에 대한 검색에서 대/소문자를 구분하지 않도록 지정하려면 true이고, 대/소문자를 구분하도록 지정하려면 false입니다.

bindingAttr
BindingFlags

typeName 생성자 검색에 영향을 미치는 0 또는 그 이상의 비트 플래그 조합입니다. bindingAttr가 0이면 대/소문자를 구분한 public 생성자 검색이 수행됩니다.

binder
Binder

bindingAttrargs을(를) 사용하여 typeName 생성자를 식별하고 검색하는 개체입니다. bindernull이면 기본 바인더가 사용됩니다.

args
Object[]

호출할 생성자의 매개 변수와 수, 순서 및 유형 면에서 일치하는 인수의 배열입니다. args이(가) 빈 배열이거나 null이면 매개 변수를 사용하지 않는 생성자(매개 변수가 없는 생성자)가 호출됩니다.

culture
CultureInfo

typeName 생성자에 대해 선언된 공식적인 형식에 args를 강제로 적용하는 것을 제어하는 문화권별 정보입니다. culturenull이면 현재 스레드의 CultureInfo가 사용됩니다.

activationAttributes
Object[]

활성화할 수 있는 하나 이상의 특성으로 이루어진 배열입니다. 일반적으로 원격 개체를 활성화 하는 데 필요한 URL을 지정하는 단일 UrlAttribute 개체가 포함된 배열입니다.

이 매개 변수는 클라이언트 활성 개체와 관련되어 있습니다. 클라이언트 활성화는 이전 버전과의 호환성을 위해 유지되지만 새로운 개발에는 권장되지 않는 레거시 기술입니다. 분산된 애플리케이션은 Windows Communication Foundation을 사용해야 합니다.

securityInfo
Evidence

보안 정책을 결정하고 코드 권한을 부여하는 데 사용되는 정보입니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

특성

예외

typeName이(가) null인 경우

일치하는 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

호출자에게 필요한 FileIOPermission이 없습니다.

activationAttributes가 빈 배열이 아니므로 생성될 형식이 MarshalByRefObject에서 파생되지 않습니다.

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

CLR(공용 언어 런타임) 버전 2.0 이상이 현재 로드되었는데 현재 로드된 버전보다 최신 버전인 CLR에 대해 assemblyName이 컴파일되었습니다. .NET Framework 버전 2.0, 3.0 및 3.5는 모두 CLR 버전 2.0을 사용합니다.

설명

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상

CreateInstanceFrom(AppDomain, String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 지정된 원격 도메인에 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(AppDomain ^ domain, System::String ^ assemblyFile, System::String ^ typeName, bool ignoreCase, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes);
[System.Security.SecurityCritical]
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes);
[<System.Security.SecurityCritical>]
static member CreateInstanceFrom : AppDomain * string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (domain As AppDomain, assemblyFile As String, typeName As String, ignoreCase As Boolean, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object()) As ObjectHandle

매개 변수

domain
AppDomain

typeName이라는 형식이 만들어지는 원격 도메인입니다.

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

ignoreCase
Boolean

typeName에 대한 검색에서 대/소문자를 구분하지 않도록 지정하려면 true이고, 대/소문자를 구분하도록 지정하려면 false입니다.

bindingAttr
BindingFlags

typeName 생성자 검색에 영향을 미치는 0 또는 그 이상의 비트 플래그 조합입니다. bindingAttr가 0이면 대/소문자를 구분한 public 생성자 검색이 수행됩니다.

binder
Binder

bindingAttrargs을(를) 사용하여 typeName 생성자를 식별하고 검색하는 개체입니다. bindernull이면 기본 바인더가 사용됩니다.

args
Object[]

호출할 생성자의 매개 변수와 수, 순서 및 유형 면에서 일치하는 인수의 배열입니다. args이(가) 빈 배열이거나 null이면 매개 변수를 사용하지 않는 생성자(매개 변수가 없는 생성자)가 호출됩니다.

culture
CultureInfo

typeName 생성자에 대해 선언된 공식적인 형식에 args를 강제로 적용하는 것을 제어하는 문화권별 정보입니다. culturenull이면 현재 스레드의 CultureInfo가 사용됩니다.

activationAttributes
Object[]

활성화할 수 있는 하나 이상의 특성으로 이루어진 배열입니다. 일반적으로 원격 개체를 활성화 하는 데 필요한 URL을 지정하는 단일 UrlAttribute 개체가 포함된 배열입니다.

이 매개 변수는 클라이언트 활성 개체와 관련되어 있습니다. 클라이언트 활성화는 이전 버전과의 호환성을 위해 유지되지만 새로운 개발에는 권장되지 않는 레거시 기술입니다. 분산된 애플리케이션은 Windows Communication Foundation을 사용해야 합니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

특성

예외

domain 또는 typeNamenull인 경우

일치하는 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

호출자에게 필요한 FileIOPermission이 있는 경우

activationAttributes가 빈 배열이 아니므로 생성될 형식이 MarshalByRefObject에서 파생되지 않습니다.

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

현재 로드 중인 버전 이후 버전의 공용 언어 런타임에 대해 assemblyName이 컴파일된 경우

설명

사용 하 여 CreateInstanceFrom 호스트 제한 된 보안 권한을 가진 애플리케이션 도메인에서 코드를 실행 해야 할 경우.

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상

CreateInstanceFrom(String, String, Object[])

Source:
Activator.cs
Source:
Activator.cs
Source:
Activator.cs

명명된 어셈블리 파일 및 매개 변수가 없는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName, cli::array <System::Object ^> ^ activationAttributes);
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom (string assemblyFile, string typeName, object?[]? activationAttributes);
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
static member CreateInstanceFrom : string * string * obj[] -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (assemblyFile As String, typeName As String, activationAttributes As Object()) As ObjectHandle

매개 변수

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

activationAttributes
Object[]

활성화할 수 있는 하나 이상의 특성으로 이루어진 배열입니다. 일반적으로 원격 개체를 활성화 하는 데 필요한 URL을 지정하는 단일 UrlAttribute 개체가 포함된 배열입니다.

이 매개 변수는 클라이언트 활성 개체와 관련되어 있습니다. 클라이언트 활성화는 이전 버전과의 호환성을 위해 유지되지만 새로운 개발에는 권장되지 않는 레거시 기술입니다. 분산된 애플리케이션은 Windows Communication Foundation을 사용해야 합니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

예외

typeName이(가) null인 경우

일치하는 public 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

activationAttributes가 빈 배열이 아니므로 생성될 형식이 MarshalByRefObject에서 파생되지 않습니다.

호출자에게 필요한 FileIOPermission이 있는 경우

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

CLR(공용 언어 런타임) 버전 2.0 이상이 현재 로드되었는데 현재 로드된 버전보다 최신 버전인 CLR에 대해 assemblyName이 컴파일되었습니다. .NET Framework 버전 2.0, 3.0 및 3.5는 모두 CLR 버전 2.0을 사용합니다.

설명

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상

CreateInstanceFrom(AppDomain, String, String)

명명된 어셈블리 파일 및 매개 변수가 없는 생성자를 사용하여 지정된 원격 도메인에 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(AppDomain ^ domain, System::String ^ assemblyFile, System::String ^ typeName);
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName);
[System.Security.SecurityCritical]
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName);
static member CreateInstanceFrom : AppDomain * string * string -> System.Runtime.Remoting.ObjectHandle
[<System.Security.SecurityCritical>]
static member CreateInstanceFrom : AppDomain * string * string -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (domain As AppDomain, assemblyFile As String, typeName As String) As ObjectHandle

매개 변수

domain
AppDomain

typeName이라는 형식이 만들어지는 원격 도메인입니다.

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

특성

예외

domain 또는 typeNamenull인 경우

일치하는 public 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

호출자에게 필요한 FileIOPermission이 있는 경우

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

CLR(공용 언어 런타임) 버전 2.0 이상이 현재 로드되었는데 현재 로드된 버전보다 최신 버전인 CLR에 대해 assemblyName이 컴파일되었습니다. .NET Framework 버전 2.0, 3.0 및 3.5는 모두 CLR 버전 2.0을 사용합니다.

설명

사용 하 여 CreateInstanceFrom 호스트 제한 된 보안 권한을 가진 애플리케이션 도메인에서 코드를 실행 해야 할 경우.

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상

CreateInstanceFrom(String, String)

Source:
Activator.cs
Source:
Activator.cs
Source:
Activator.cs

명명된 어셈블리 파일 및 매개 변수가 없는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName);
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom (string assemblyFile, string typeName);
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
static member CreateInstanceFrom : string * string -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (assemblyFile As String, typeName As String) As ObjectHandle

매개 변수

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

예외

typeName이(가) null인 경우

일치하는 public 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

호출자에게 필요한 FileIOPermission이 있는 경우

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

CLR(공용 언어 런타임) 버전 2.0 이상이 현재 로드되었는데 현재 로드된 버전보다 최신 버전인 CLR에 대해 assemblyName이 컴파일되었습니다. .NET Framework 버전 2.0, 3.0 및 3.5는 모두 CLR 버전 2.0을 사용합니다.

예제

다음 코드 예제를 호출 하는 방법을 보여 줍니다는 CreateInstanceFrom 메서드. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 Activator 클래스입니다.

// Create an instance of the SomeType class that is defined in this 
// assembly.
System::Runtime::Remoting::ObjectHandle^ oh = 
    Activator::CreateInstanceFrom(Assembly::GetEntryAssembly()->CodeBase, 
                                  SomeType::typeid->FullName);

// Call an instance method defined by the SomeType type using this object.
SomeType^ st = (SomeType^) oh->Unwrap();

st->DoSomething(5);
// Create an instance of the SomeType class that is defined in this
// assembly.
System.Runtime.Remoting.ObjectHandle oh =
    Activator.CreateInstanceFrom(Assembly.GetEntryAssembly().CodeBase,
                                 typeof(SomeType).FullName);

// Call an instance method defined by the SomeType type using this object.
SomeType st = (SomeType) oh.Unwrap();

st.DoSomething(5);
// Create an instance of the SomeType class that is defined in this assembly.
let oh = 
    Activator.CreateInstanceFrom(Assembly.GetEntryAssembly().Location, typeof<SomeType>.FullName)

// Call an instance method defined by the SomeType type using this object.
let st = oh.Unwrap() :?> SomeType

st.DoSomething 5
' Create an instance of the SomeType class that is defined in this assembly.
Dim oh As System.Runtime.Remoting.ObjectHandle = _
    Activator.CreateInstanceFrom(Assembly.GetEntryAssembly().CodeBase, _
                                 GetType(SomeType).FullName)

' Call an instance method defined by the SomeType type using this object.
Dim st As SomeType = CType(oh.Unwrap(), SomeType)

st.DoSomething(5)

설명

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상

CreateInstanceFrom(String, String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

Source:
Activator.cs
Source:
Activator.cs
Source:
Activator.cs

명명된 어셈블리 파일 및 지정된 매개 변수와 가장 일치하는 생성자를 사용하여 이름이 지정된 형식의 인스턴스를 만듭니다.

public:
 static System::Runtime::Remoting::ObjectHandle ^ CreateInstanceFrom(System::String ^ assemblyFile, System::String ^ typeName, bool ignoreCase, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes);
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes);
public static System.Runtime.Remoting.ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes);
static member CreateInstanceFrom : string * string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] -> System.Runtime.Remoting.ObjectHandle
Public Shared Function CreateInstanceFrom (assemblyFile As String, typeName As String, ignoreCase As Boolean, bindingAttr As BindingFlags, binder As Binder, args As Object(), culture As CultureInfo, activationAttributes As Object()) As ObjectHandle

매개 변수

assemblyFile
String

형식 typeName이(가) 검색되는 어셈블리를 포함하는 파일의 이름입니다.

typeName
String

인스턴스를 만들 형식의 이름입니다.

ignoreCase
Boolean

typeName에 대한 검색에서 대/소문자를 구분하지 않도록 지정하려면 true이고, 대/소문자를 구분하도록 지정하려면 false입니다.

bindingAttr
BindingFlags

typeName 생성자 검색에 영향을 미치는 0 또는 그 이상의 비트 플래그 조합입니다. bindingAttr가 0이면 대/소문자를 구분한 public 생성자 검색이 수행됩니다.

binder
Binder

bindingAttrargs을(를) 사용하여 typeName 생성자를 식별하고 검색하는 개체입니다. bindernull이면 기본 바인더가 사용됩니다.

args
Object[]

호출할 생성자의 매개 변수와 수, 순서 및 유형 면에서 일치하는 인수의 배열입니다. args이(가) 빈 배열이거나 null이면 매개 변수를 사용하지 않는 생성자(매개 변수가 없는 생성자)가 호출됩니다.

culture
CultureInfo

typeName 생성자에 대해 선언된 공식적인 형식에 args를 강제로 적용하는 것을 제어하는 문화권별 정보입니다. culturenull이면 현재 스레드의 CultureInfo가 사용됩니다.

activationAttributes
Object[]

활성화할 수 있는 하나 이상의 특성으로 이루어진 배열입니다. 일반적으로 원격 개체를 활성화 하는 데 필요한 URL을 지정하는 단일 UrlAttribute 개체가 포함된 배열입니다.

이 매개 변수는 클라이언트 활성 개체와 관련되어 있습니다. 클라이언트 활성화는 이전 버전과의 호환성을 위해 유지되지만 새로운 개발에는 권장되지 않는 레거시 기술입니다. 분산된 애플리케이션은 Windows Communication Foundation을 사용해야 합니다.

반환

새로 만든 개체 또는 null 인스턴스에 액세스하려면 래핑을 해제해야 하는 Nullable<T> 핸들입니다.

예외

typeName이(가) null인 경우

일치하는 생성자를 찾을 수 없습니다.

assemblyFile에서 typename을 찾을 수 없습니다.

assemblyFile을 찾을 수 없습니다.

호출자에게 이 생성자를 호출할 수 있는 권한이 없습니다.

추상 클래스의 인스턴스를 만들 수 없거나 이 멤버가 런타임에 바인딩 메커니즘을 사용하여 호출되었습니다.

리플렉션을 통해 호출된 생성자가 예외를 발생시킵니다.

호출자에게 필요한 FileIOPermission이 없습니다.

activationAttributes가 빈 배열이 아니므로 생성될 형식이 MarshalByRefObject에서 파생되지 않습니다.

assemblyFile는 유효한 어셈블리가 아닙니다.

또는

CLR(공용 언어 런타임) 버전 2.0 이상이 현재 로드되었는데 현재 로드된 버전보다 최신 버전인 CLR에 대해 assemblyName이 컴파일되었습니다. .NET Framework 버전 2.0, 3.0 및 3.5는 모두 CLR 버전 2.0을 사용합니다.

설명

메서드를 ObjectHandle.Unwrap 사용하여 반환 값을 래프 해제합니다.

호출된 메서드에서 throw할 수 있는 다른 예외에 대한 자세한 내용은 및 CreateInstance 메서드의 예외 섹션을 Assembly.LoadFrom 참조하세요.

적용 대상