CompilerResults Class
Represents the results of compilation that are returned from a compiler.
System.CodeDom.Compiler::CompilerResults
System.Workflow.ComponentModel.Compiler::WorkflowCompilerResults
Assembly: System (in System.dll)
The CompilerResults type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | CompilerResults | Initializes a new instance of the CompilerResults class that uses the specified temporary files. |
| Name | Description | |
|---|---|---|
![]() | CompiledAssembly | Gets or sets the compiled assembly. |
![]() | Errors | Gets the collection of compiler errors and warnings. |
![]() | Evidence | Obsolete. Indicates the evidence object that represents the security policy permissions of the compiled assembly. |
![]() | NativeCompilerReturnValue | Gets or sets the compiler's return value. |
![]() | Output | Gets the compiler output messages. |
![]() | PathToAssembly | Gets or sets the path of the compiled assembly. |
![]() | TempFiles | Gets or sets the temporary file collection to use. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
This class contains the following information about the results of a compilation by an ICodeCompiler interface implementation:
The CompiledAssembly property indicates the compiled assembly.
The Evidence property indicates the security evidence for the assembly.
The PathToAssembly property indicates the path to the compiled assembly, if it was not generated only in memory.
The Errors property indicates any compiler errors and warnings.
The Output property contains the compiler output messages.
The NativeCompilerReturnValue property indicates result code value returned by the compiler.
The TempFiles property indicates the temporary files generated during compilation and linking.
Note |
|---|
This class contains an inheritance demand at the class level that applies to all members. A SecurityException is thrown when the derived class does not have full-trust permission. For details about inheritance demands, see Inheritance Demands. |
// 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) ); } } }
- SecurityAction::InheritanceDemand
for full trust for inheritors. This class cannot be inherited by partially trusted code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
