The BuildResult
property of the Compiler
class provides the results of the assembly build process. This result can include warnings or errors that occurred during the build.
The BuildResult
property of the Compiler
class provides the results of the assembly build process. This result can include warnings or errors that occurred during the build.
Use the BuildResult
property to access the outcome of the most recent build operation. This property returns an EmitResult
object, which contains detailed information about the success or failure of the build, including any diagnostics such as warnings or errors.
// Example of accessing the BuildResult property // Assume 'compiler' is an instance of Sandbox.Compiler var buildResult = compiler.BuildResult; // Check if the build was successful if (buildResult.Success) { // Handle successful build Console.WriteLine("Build succeeded."); } else { // Handle build errors foreach (var diagnostic in buildResult.Diagnostics) { Console.WriteLine($"Error: {diagnostic.GetMessage()}"); } }