CompilerResults 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컴파일러에서 반환되는 컴파일 결과를 나타냅니다.
public ref class CompilerResults
public class CompilerResults
[System.Serializable]
public class CompilerResults
type CompilerResults = class
[<System.Serializable>]
type CompilerResults = class
Public Class CompilerResults
- 상속
-
CompilerResults
- 파생
- 특성
예제
// Displays information from a CompilerResults.
public static void DisplayCompilerResults(System.CodeDom.Compiler.CompilerResults cr)
{
// If errors occurred during compilation, output the compiler output and errors.
if( cr.Errors.Count > 0 )
{
for( int i=0; i<cr.Output.Count; i++ )
Console.WriteLine( cr.Output[i] );
for( int i=0; i<cr.Errors.Count; i++ )
Console.WriteLine( i.ToString() + ": " + cr.Errors[i].ToString() );
}
else
{
// Display information about the compiler's exit code and the generated assembly.
Console.WriteLine( "Compiler returned with result code: " + cr.NativeCompilerReturnValue.ToString() );
Console.WriteLine( "Generated assembly name: " + cr.CompiledAssembly.FullName );
if( cr.PathToAssembly == null )
Console.WriteLine( "The assembly has been generated in memory." );
else
Console.WriteLine( "Path to assembly: " + cr.PathToAssembly );
// Display temporary files information.
if( !cr.TempFiles.KeepFiles )
{
Console.WriteLine( "Temporary build files were deleted." );
}
else
{
Console.WriteLine( "Temporary build files were not deleted." );
// Display a list of the temporary build files
IEnumerator enu = cr.TempFiles.GetEnumerator();
for( int i=0; enu.MoveNext(); i++ )
Console.WriteLine( "TempFile " + i.ToString() + ": " + (string)enu.Current );
}
}
}
' Displays information from a CompilerResults.
Public Shared Sub DisplayCompilerResults(ByVal cr As System.CodeDom.Compiler.CompilerResults)
' If errors occurred during compilation, output the compiler output and errors.
If cr.Errors.Count > 0 Then
Dim i As Integer
For i = 0 To cr.Output.Count - 1
Console.WriteLine(cr.Output(i))
Next i
For i = 0 To cr.Errors.Count - 1
Console.WriteLine((i.ToString() + ": " + cr.Errors(i).ToString()))
Next i
Else
' Display information about the compiler's exit code and the generated assembly.
Console.WriteLine(("Compiler returned with result code: " + cr.NativeCompilerReturnValue.ToString()))
Console.WriteLine(("Generated assembly name: " + cr.CompiledAssembly.FullName))
If cr.PathToAssembly Is Nothing Then
Console.WriteLine("The assembly has been generated in memory.")
Else
Console.WriteLine(("Path to assembly: " + cr.PathToAssembly))
End If
' Display temporary files information.
If Not cr.TempFiles.KeepFiles Then
Console.WriteLine("Temporary build files were deleted.")
Else
Console.WriteLine("Temporary build files were not deleted.")
' Display a list of the temporary build files
Dim enu As IEnumerator = cr.TempFiles.GetEnumerator()
Dim i As Integer
i = 0
While enu.MoveNext()
Console.WriteLine(("TempFile " + i.ToString() + ": " + CStr(enu.Current)))
i += 1
End While
End If
End If
End Sub
설명
이 클래스에는 인터페이스 구현에 의한 컴파일 결과에 대한 다음 정보가 포함되어 있습니다 ICodeCompiler .
이 속성은 CompiledAssembly 컴파일된 어셈블리를 나타냅니다.
이 속성은 Evidence 어셈블리에 대한 보안 증거를 나타냅니다.
이 속성은 PathToAssembly 메모리에서만 생성되지 않은 경우 컴파일된 어셈블리의 경로를 나타냅니다.
이 속성은 Errors 컴파일러 오류 및 경고를 나타냅니다.
이 속성에는 Output 컴파일러 출력 메시지가 포함됩니다.
이 속성은 NativeCompilerReturnValue 컴파일러에서 반환된 결과 코드 값을 나타냅니다.
이 속성은 TempFiles 컴파일 및 연결 중에 생성된 임시 파일을 나타냅니다.
메모
이 클래스에는 모든 멤버에 적용되는 클래스 수준의 상속 요청이 포함됩니다. 파생 클래스에 완전 신뢰 권한이 없는 경우 A SecurityException 가 throw됩니다. 상속 요구 사항에 대한 자세한 내용은 상속 요구를 참조하세요.
생성자
| Name | Description |
|---|---|
| CompilerResults(TempFileCollection) |
지정된 임시 파일을 사용하는 클래스의 CompilerResults 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| CompiledAssembly |
컴파일된 어셈블리를 가져오거나 설정합니다. |
| Errors |
컴파일러 오류 및 경고의 컬렉션을 가져옵니다. |
| Evidence |
사용되지 않음.
컴파일된 어셈블리의 보안 정책 권한을 나타내는 evidence 개체를 나타냅니다. |
| NativeCompilerReturnValue |
컴파일러의 반환 값을 가져오거나 설정합니다. |
| Output |
컴파일러 출력 메시지를 가져옵니다. |
| PathToAssembly |
컴파일된 어셈블리의 경로를 가져오거나 설정합니다. |
| TempFiles |
사용할 임시 파일 컬렉션을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |