언어

Assembly.UnsafeLoadFrom(String) 메서드

정의

일부 보안 검사를 우회하여 어셈블리를 부하에서 컨텍스트로 로드합니다.

public:
 static System::Reflection::Assembly ^ UnsafeLoadFrom(System::String ^ assemblyFile);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly UnsafeLoadFrom(string assemblyFile);
public static System.Reflection.Assembly UnsafeLoadFrom(string assemblyFile);
[System.Security.SecurityCritical]
public static System.Reflection.Assembly UnsafeLoadFrom(string assemblyFile);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")>]
static member UnsafeLoadFrom : string -> System.Reflection.Assembly
static member UnsafeLoadFrom : string -> System.Reflection.Assembly
[<System.Security.SecurityCritical>]
static member UnsafeLoadFrom : string -> System.Reflection.Assembly
Public Shared Function UnsafeLoadFrom (assemblyFile As String) As Assembly

매개 변수

assemblyFile
String

어셈블리의 매니페스트를 포함하는 파일의 이름 또는 경로입니다.

반품

로드된 어셈블리입니다.

특성

예외

assemblyFile은 null입니다.

assemblyFile 을(를) 찾을 수 없거나 로드하려는 모듈에서 파일 이름 확장자를 지정하지 않습니다.

발견된 파일을 로드할 수 없습니다.

assemblyFile 가 현재 로드된 런타임에 유효한 어셈블리가 아닌 경우

"file://"로 시작하지 않는 코드베이스가 필요 WebPermission없이 지정되었습니다.

assemblyFile 매개 변수는 빈 문자열("")입니다.

어셈블리 이름이 시스템 정의 최대 길이를 초과합니다.

설명

이 메서드를 사용하여 운영 체제가 웹에서 로드된 것으로 플래그가 지정된 로컬 어셈블리를 로드합니다(예: 인터넷 또는 인트라넷에서 다운로드된 임시 파일). .NET Framework 4 이전에는 이러한 어셈블리가 샌드박스 애플리케이션 도메인에 자동으로 로드되었습니다. .NET Framework 4부터 완전 신뢰로 로드됩니다.

이 메서드를 사용하는 대신 애플리케이션 구성 파일에 NetFx40_LegacySecurityPolicy< 요소를 적용>할 수 있습니다. 이로 인해 공용 언어 런타임이 .NET Framework 3.5의 보안 정책으로 되돌아갑니다.

Caution

이러한 솔루션 중 하나를 사용하는 경우 완전 신뢰로 로드 assemblyFile 해도 안전한지 확인해야 합니다.

부하 컨텍스트를 포함하여 로드 컨텍스트에 대한 자세한 내용은 메서드 오버로드를 LoadFrom(String) 참조하세요.

적용 대상