CompilerResults クラス
アセンブリ: System (system.dll 内)


このクラスには、ICodeCompiler インターフェイスの実装による、コンパイルの結果に関する以下の情報が含まれています。
![]() |
---|
このクラスには、すべてのメンバに適用されるクラス レベルの継承確認要求が格納されます。派生クラスに完全信頼のアクセス許可がない場合、SecurityException がスローされます。継承確認要求の詳細については、「継承確認要求」を参照してください。 |

' 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
// 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. [PermissionSet(SecurityAction::Demand, Name="FullTrust")] 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( String::Concat( i, ": ", cr->Errors[ i ] ) ); } else { // Display information ab->Item[Out] the* compiler's exit code and the generated assembly. Console::WriteLine( "Compiler returned with result code: {0}", cr->NativeCompilerReturnValue ); Console::WriteLine( "Generated assembly name: {0}", cr->CompiledAssembly->FullName ); if ( cr->PathToAssembly == nullptr ) Console::WriteLine( "The assembly has been generated in memory." ); else Console::WriteLine( "Path to assembly: {0}", 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) ); } } }


System.CodeDom.Compiler.CompilerResults


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CompilerResults コンストラクタ
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CompilerResults プロパティ

名前 | 説明 | |
---|---|---|
![]() | CompiledAssembly | コンパイル済みのアセンブリを取得または設定します。 |
![]() | Errors | コンパイラのエラーおよび警告のコレクションを取得します。 |
![]() | Evidence | コンパイル済みアセンブリのセキュリティ ポリシーのアクセス許可を表す証拠オブジェクトを示します。 |
![]() | NativeCompilerReturnValue | コンパイラからの戻り値を取得または設定します。 |
![]() | Output | コンパイラ出力メッセージを取得します。 |
![]() | PathToAssembly | コンパイル済みのアセンブリのパスを取得または設定します。 |
![]() | TempFiles | 使用する一時ファイルのコレクションを取得または設定します。 |

CompilerResults メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

CompilerResults メンバ
CompilerResults データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | CompiledAssembly | コンパイル済みのアセンブリを取得または設定します。 |
![]() | Errors | コンパイラのエラーおよび警告のコレクションを取得します。 |
![]() | Evidence | コンパイル済みアセンブリのセキュリティ ポリシーのアクセス許可を表す証拠オブジェクトを示します。 |
![]() | NativeCompilerReturnValue | コンパイラからの戻り値を取得または設定します。 |
![]() | Output | コンパイラ出力メッセージを取得します。 |
![]() | PathToAssembly | コンパイル済みのアセンブリのパスを取得または設定します。 |
![]() | TempFiles | 使用する一時ファイルのコレクションを取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- CompilerResultsのページへのリンク