CompilerParameters 클래스

정의

컴파일러를 호출하는 데 사용되는 매개 변수를 나타냅니다.

public ref class CompilerParameters
public class CompilerParameters
[System.Runtime.InteropServices.ComVisible(false)]
public class CompilerParameters
[System.Serializable]
public class CompilerParameters
type CompilerParameters = class
[<System.Runtime.InteropServices.ComVisible(false)>]
type CompilerParameters = class
[<System.Serializable>]
type CompilerParameters = class
Public Class CompilerParameters
상속
CompilerParameters
파생
특성

예제

다음 예제에서는 간단한 헬로 월드 프로그램에 대한 CodeDOM 소스 그래프를 빌드합니다. 그런 다음 소스가 파일에 저장되고 실행 파일로 컴파일되고 실행됩니다. 메서드는 CompileCode 클래스를 사용하여 CompilerParameters 다양한 컴파일러 설정 및 옵션을 지정하는 방법을 보여 줍니다.

using namespace System;
using namespace System::CodeDom;
using namespace System::CodeDom::Compiler;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::IO;
using namespace System::Diagnostics;

// Build a Hello World program graph using System.CodeDom types.
static CodeCompileUnit^ BuildHelloWorldGraph()
{
   // Create a new CodeCompileUnit to contain the program graph.
   CodeCompileUnit^ compileUnit = gcnew CodeCompileUnit;
   
   // Declare a new namespace called Samples.
   CodeNamespace^ samples = gcnew CodeNamespace( "Samples" );
   // Add the new namespace to the compile unit.
   compileUnit->Namespaces->Add( samples );
   
   // Add the new namespace import for the System namespace.
   samples->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
   
   // Declare a new type called Class1.
   CodeTypeDeclaration^ class1 = gcnew CodeTypeDeclaration( "Class1" );
   // Add the new type to the namespace's type collection.
   samples->Types->Add( class1 );
   
   // Declare a new code entry point method
   CodeEntryPointMethod^ start = gcnew CodeEntryPointMethod;
   
   // Create a type reference for the System::Console class.
   CodeTypeReferenceExpression^ csSystemConsoleType =
      gcnew CodeTypeReferenceExpression( "System.Console" );
   
   // Build a Console::WriteLine statement.
   CodeMethodInvokeExpression^ cs1 = gcnew CodeMethodInvokeExpression(
      csSystemConsoleType, "WriteLine",
      gcnew CodePrimitiveExpression( "Hello World!" ) );
   
   // Add the WriteLine call to the statement collection.
   start->Statements->Add( cs1 );
   
   // Build another Console::WriteLine statement.
   CodeMethodInvokeExpression^ cs2 = gcnew CodeMethodInvokeExpression(
      csSystemConsoleType, "WriteLine",
      gcnew CodePrimitiveExpression( "Press the Enter key to continue." ) );
   // Add the WriteLine call to the statement collection.
   start->Statements->Add( cs2 );
   
   // Build a call to System::Console::ReadLine.
   CodeMethodReferenceExpression^ csReadLine = gcnew CodeMethodReferenceExpression(
      csSystemConsoleType, "ReadLine" );
   CodeMethodInvokeExpression^ cs3 = gcnew CodeMethodInvokeExpression(
      csReadLine,gcnew array<CodeExpression^>(0) );
   
   // Add the ReadLine statement.
   start->Statements->Add( cs3 );
   
   // Add the code entry point method to the Members collection
   // of the type.
   class1->Members->Add( start );

   return compileUnit;
}

static String^ GenerateCode( CodeDomProvider^ provider, CodeCompileUnit^ compileunit )
{
   // Build the source file name with the language extension (vb, cs, js).
   String^ sourceFile = String::Empty;

      if ( provider->FileExtension->StartsWith( "." ) )
      {
         sourceFile = String::Concat( "HelloWorld", provider->FileExtension );
      }
      else
      {
         sourceFile = String::Concat( "HelloWorld.", provider->FileExtension );
      }

      // Create a TextWriter to a StreamWriter to an output file.
      IndentedTextWriter^ tw = gcnew IndentedTextWriter(
         gcnew StreamWriter( sourceFile,false ),"    " );
      // Generate source code using the code generator.
      provider->GenerateCodeFromCompileUnit( compileunit, tw, gcnew CodeGeneratorOptions );
      // Close the output file.
      tw->Close();
   return sourceFile;
}

static bool CompileCode( CodeDomProvider^ provider,
   String^ sourceFile,
   String^ exeFile )
{

   CompilerParameters^ cp = gcnew CompilerParameters;
   if ( !cp)  
   {
      return false;
   }

   // Generate an executable instead of 
   // a class library.
   cp->GenerateExecutable = true;
   
   // Set the assembly file name to generate.
   cp->OutputAssembly = exeFile;
   
   // Generate debug information.
   cp->IncludeDebugInformation = true;
   
   // Add an assembly reference.
   cp->ReferencedAssemblies->Add( "System.dll" );
   
   // Save the assembly as a physical file.
   cp->GenerateInMemory = false;
   
   // Set the level at which the compiler 
   // should start displaying warnings.
   cp->WarningLevel = 3;
   
   // Set whether to treat all warnings as errors.
   cp->TreatWarningsAsErrors = false;
   
   // Set compiler argument to optimize output.
   cp->CompilerOptions = "/optimize";
   
   // Set a temporary files collection.
   // The TempFileCollection stores the temporary files
   // generated during a build in the current directory,
   // and does not delete them after compilation.
   cp->TempFiles = gcnew TempFileCollection( ".",true );

   if ( provider->Supports( GeneratorSupport::EntryPointMethod ) )
   {
      // Specify the class that contains 
      // the main method of the executable.
      cp->MainClass = "Samples.Class1";
   }

   if ( Directory::Exists( "Resources" ) )
   {
      if ( provider->Supports( GeneratorSupport::Resources ) )
      {
         // Set the embedded resource file of the assembly.
         // This is useful for culture-neutral resources,
         // or default (fallback) resources.
         cp->EmbeddedResources->Add( "Resources\\Default.resources" );

         // Set the linked resource reference files of the assembly.
         // These resources are included in separate assembly files,
         // typically localized for a specific language and culture.
         cp->LinkedResources->Add( "Resources\\nb-no.resources" );
      }
   }

   // Invoke compilation.
   CompilerResults^ cr = provider->CompileAssemblyFromFile( cp, sourceFile );

   if ( cr->Errors->Count > 0 )
   {
      // Display compilation errors.
      Console::WriteLine( "Errors building {0} into {1}",
         sourceFile, cr->PathToAssembly );
      for each ( CompilerError^ ce in cr->Errors )
      {
         Console::WriteLine( "  {0}", ce->ToString() );
         Console::WriteLine();
      }
   }
   else
   {
      Console::WriteLine( "Source {0} built into {1} successfully.",
         sourceFile, cr->PathToAssembly );
   }

   // Return the results of compilation.
   if ( cr->Errors->Count > 0 )
   {
      return false;
   }
   else
   {
      return true;
   }
}

[STAThread]
void main()
{
   String^ exeName = "HelloWorld.exe";
   CodeDomProvider^ provider = nullptr;

   Console::WriteLine( "Enter the source language for Hello World (cs, vb, etc):" );
   String^ inputLang = Console::ReadLine();
   Console::WriteLine();

   if ( CodeDomProvider::IsDefinedLanguage( inputLang ) )
   {
      CodeCompileUnit^ helloWorld = BuildHelloWorldGraph();
      provider = CodeDomProvider::CreateProvider( inputLang );
      if ( helloWorld && provider )
      {
         String^ sourceFile = GenerateCode( provider, helloWorld );
         Console::WriteLine( "HelloWorld source code generated." );
         if ( CompileCode( provider, sourceFile, exeName ) )
         {
            Console::WriteLine( "Starting HelloWorld executable." );
            Process::Start( exeName );
         }
      }
   }

   if ( provider == nullptr )
   {
      Console::WriteLine( "There is no CodeDomProvider for the input language." );
   }
}
using System;
using System.Globalization;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections;
using System.ComponentModel;
using System.IO;
using System.Diagnostics;

namespace CompilerParametersExample
{
    class CompileClass
    {
        // Build a Hello World program graph using System.CodeDom types.
        public static CodeCompileUnit BuildHelloWorldGraph()
        {
            // Create a new CodeCompileUnit to contain the program graph
            CodeCompileUnit compileUnit = new CodeCompileUnit();

            // Declare a new namespace called Samples.
            CodeNamespace samples = new CodeNamespace("Samples");
            // Add the new namespace to the compile unit.
            compileUnit.Namespaces.Add( samples );

            // Add the new namespace import for the System namespace.
            samples.Imports.Add( new CodeNamespaceImport("System") );

            // Declare a new type called Class1.
            CodeTypeDeclaration class1 = new CodeTypeDeclaration("Class1");
            // Add the new type to the namespace's type collection.
            samples.Types.Add(class1);

            // Declare a new code entry point method.
            CodeEntryPointMethod start = new CodeEntryPointMethod();

            // Create a type reference for the System.Console class.
            CodeTypeReferenceExpression csSystemConsoleType = new CodeTypeReferenceExpression("System.Console");

            // Build a Console.WriteLine statement.
            CodeMethodInvokeExpression cs1 = new CodeMethodInvokeExpression(
                csSystemConsoleType, "WriteLine",
                new CodePrimitiveExpression("Hello World!") );

            // Add the WriteLine call to the statement collection.
            start.Statements.Add(cs1);

            // Build another Console.WriteLine statement.
            CodeMethodInvokeExpression cs2 = new CodeMethodInvokeExpression(
                csSystemConsoleType, "WriteLine",
                new CodePrimitiveExpression("Press the Enter key to continue.") );
            // Add the WriteLine call to the statement collection.
            start.Statements.Add(cs2);

            // Build a call to System.Console.ReadLine.
            CodeMethodInvokeExpression csReadLine = new CodeMethodInvokeExpression(
                csSystemConsoleType, "ReadLine");

            // Add the ReadLine statement.
            start.Statements.Add(csReadLine);

            // Add the code entry point method to the Members
            // collection of the type.
            class1.Members.Add( start );

            return compileUnit;
        }

        public static String GenerateCode(CodeDomProvider provider,
                                          CodeCompileUnit compileunit)
        {
            // Build the source file name with the language
            // extension (vb, cs, js).
            String sourceFile;
            if (provider.FileExtension[0] == '.')
            {
                sourceFile = "HelloWorld" + provider.FileExtension;
            }
            else
            {
                sourceFile = "HelloWorld." + provider.FileExtension;
            }

            // Create a TextWriter to a StreamWriter to an output file.
            IndentedTextWriter tw = new IndentedTextWriter(new StreamWriter(sourceFile, false), "    ");
            // Generate source code using the code provider.
            provider.GenerateCodeFromCompileUnit(compileunit, tw, new CodeGeneratorOptions());
            // Close the output file.
            tw.Close();

            return sourceFile;
        }

        public static bool CompileCode(CodeDomProvider provider,
            String sourceFile,
            String exeFile)
        {

            CompilerParameters cp = new CompilerParameters();

            // Generate an executable instead of
            // a class library.
            cp.GenerateExecutable = true;

            // Set the assembly file name to generate.
            cp.OutputAssembly = exeFile;

            // Generate debug information.
            cp.IncludeDebugInformation = true;

            // Add an assembly reference.
            cp.ReferencedAssemblies.Add( "System.dll" );

            // Save the assembly as a physical file.
            cp.GenerateInMemory = false;

            // Set the level at which the compiler
            // should start displaying warnings.
            cp.WarningLevel = 3;

            // Set whether to treat all warnings as errors.
            cp.TreatWarningsAsErrors = false;

            // Set compiler argument to optimize output.
            cp.CompilerOptions = "/optimize";

            // Set a temporary files collection.
            // The TempFileCollection stores the temporary files
            // generated during a build in the current directory,
            // and does not delete them after compilation.
            cp.TempFiles = new TempFileCollection(".", true);

            if (provider.Supports(GeneratorSupport.EntryPointMethod))
            {
                // Specify the class that contains
                // the main method of the executable.
                cp.MainClass = "Samples.Class1";
            }

            if (Directory.Exists("Resources"))
            {
                if (provider.Supports(GeneratorSupport.Resources))
                {
                    // Set the embedded resource file of the assembly.
                    // This is useful for culture-neutral resources,
                    // or default (fallback) resources.
                    cp.EmbeddedResources.Add("Resources\\Default.resources");

                    // Set the linked resource reference files of the assembly.
                    // These resources are included in separate assembly files,
                    // typically localized for a specific language and culture.
                    cp.LinkedResources.Add("Resources\\nb-no.resources");
                }
            }

            // Invoke compilation.
            CompilerResults cr = provider.CompileAssemblyFromFile(cp, sourceFile);

            if(cr.Errors.Count > 0)
            {
                // Display compilation errors.
                Console.WriteLine("Errors building {0} into {1}",
                    sourceFile, cr.PathToAssembly);
                foreach(CompilerError ce in cr.Errors)
                {
                    Console.WriteLine("  {0}", ce.ToString());
                    Console.WriteLine();
                }
            }
            else
            {
                Console.WriteLine("Source {0} built into {1} successfully.",
                    sourceFile, cr.PathToAssembly);
                Console.WriteLine("{0} temporary files created during the compilation.",
                    cp.TempFiles.Count.ToString());
            }

            // Return the results of compilation.
            if (cr.Errors.Count > 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        [STAThread]
        static void Main()
        {
            CodeDomProvider provider = null;
            String exeName = "HelloWorld.exe";

            Console.WriteLine("Enter the source language for Hello World (cs, vb, etc):");
            String inputLang = Console.ReadLine();
            Console.WriteLine();

            if (CodeDomProvider.IsDefinedLanguage(inputLang))
            {
                provider = CodeDomProvider.CreateProvider(inputLang);
            }

            if (provider == null)
            {
                Console.WriteLine("There is no CodeDomProvider for the input language.");
            }
            else
            {
                CodeCompileUnit helloWorld = BuildHelloWorldGraph();

                String sourceFile = GenerateCode(provider, helloWorld);

                Console.WriteLine("HelloWorld source code generated.");

                if (CompileCode(provider, sourceFile, exeName ))
                {
                    Console.WriteLine("Starting HelloWorld executable.");
                    Process.Start(exeName);
                }
            }
        }
    }
}
Imports System.Globalization
Imports System.CodeDom
Imports System.CodeDom.Compiler
Imports System.Collections
Imports System.ComponentModel
Imports System.IO
Imports System.Diagnostics

Namespace CompilerParametersExample

    Class CompileClass

        ' Build a Hello World program graph using System.CodeDom types.
        Public Shared Function BuildHelloWorldGraph() As CodeCompileUnit

            ' Create a new CodeCompileUnit to contain the program graph.
            Dim compileUnit As New CodeCompileUnit()

            ' Declare a new namespace called Samples.
            Dim samples As New CodeNamespace("Samples")

            ' Add the new namespace to the compile unit.
            compileUnit.Namespaces.Add(samples)

            ' Add the new namespace import for the System namespace.
            samples.Imports.Add(New CodeNamespaceImport("System"))

            ' Declare a new type called Class1.
            Dim Class1 As New CodeTypeDeclaration("Class1")

            ' Add the new type to the namespace's type collection.
            samples.Types.Add(class1)

            ' Declare a new code entry point method
            Dim start As New CodeEntryPointMethod()

            ' Create a type reference for the System.Console class.
            Dim csSystemConsoleType As New CodeTypeReferenceExpression( _
                "System.Console")

            ' Build a Console.WriteLine statement.
            Dim cs1 As New CodeMethodInvokeExpression( _
                csSystemConsoleType, "WriteLine", _
                New CodePrimitiveExpression("Hello World!"))

            ' Add the WriteLine call to the statement collection.
            start.Statements.Add(cs1)

            ' Build another Console.WriteLine statement.
            Dim cs2 As New CodeMethodInvokeExpression( _
                csSystemConsoleType, "WriteLine", _
                New CodePrimitiveExpression("Press the Enter key to continue."))

            ' Add the WriteLine call to the statement collection.
            start.Statements.Add(cs2)

            ' Build a call to System.Console.ReadLine.
            Dim csReadLine As New CodeMethodInvokeExpression( _
                csSystemConsoleType, "ReadLine")

            ' Add the ReadLine statement.
            start.Statements.Add(csReadLine)

            ' Add the code entry point method to the Members
            ' collection of the type.
            class1.Members.Add(start)

            Return compileUnit
        End Function


        Public Shared Function GenerateCode(ByVal provider As CodeDomProvider, _
        ByVal compileunit As CodeCompileUnit) As String

            ' Build the source file name with the language extension (vb, cs, js).
            Dim sourceFile As String
            If provider.FileExtension.StartsWith(".") Then
                sourceFile = "HelloWorld" + provider.FileExtension
            Else
                sourceFile = "HelloWorld." + provider.FileExtension
            End If

            ' Create a TextWriter to a StreamWriter to an output file.
            Dim tw As New IndentedTextWriter(New StreamWriter(sourceFile, False), "    ")

            ' Generate source code using the code provider.
            provider.GenerateCodeFromCompileUnit(compileunit, tw, _
                New CodeGeneratorOptions())

            ' Close the output file.
            tw.Close()

            Return sourceFile
        End Function 'GenerateCode


        Public Shared Function CompileCode(ByVal provider As CodeDomProvider, _
        ByVal sourceFile As String, ByVal exeFile As String) As Boolean

            Dim cp As New CompilerParameters()

            ' Generate an executable instead of 
            ' a class library.
            cp.GenerateExecutable = True

            ' Set the assembly file name to generate.
            cp.OutputAssembly = exeFile

            ' Generate debug information.
            cp.IncludeDebugInformation = True

            ' Add an assembly reference.
            cp.ReferencedAssemblies.Add("System.dll")

            ' Save the assembly as a physical file.
            cp.GenerateInMemory = False

            ' Set the level at which the compiler 
            ' should start displaying warnings.
            cp.WarningLevel = 3

            ' Set whether to treat all warnings as errors.
            cp.TreatWarningsAsErrors = False

            ' Set compiler argument to optimize output.
            cp.CompilerOptions = "/optimize"

            ' Set a temporary files collection.
            ' The TempFileCollection stores the temporary files
            ' generated during a build in the current directory,
            ' and does not delete them after compilation.
            cp.TempFiles = New TempFileCollection(".", True)

            If provider.Supports(GeneratorSupport.EntryPointMethod) Then
                ' Specify the class that contains
                ' the main method of the executable.
                cp.MainClass = "Samples.Class1"
            End If


            If Directory.Exists("Resources") Then
                If provider.Supports(GeneratorSupport.Resources) Then
                    ' Set the embedded resource file of the assembly.
                    ' This is useful for culture-neutral resources,
                    ' or default (fallback) resources.
                    cp.EmbeddedResources.Add("Resources\Default.resources")

                    ' Set the linked resource reference files of the assembly.
                    ' These resources are included in separate assembly files,
                    ' typically localized for a specific language and culture.
                    cp.LinkedResources.Add("Resources\nb-no.resources")
                End If
            End If

            ' Invoke compilation.
            Dim cr As CompilerResults = _
                provider.CompileAssemblyFromFile(cp, sourceFile)

            If cr.Errors.Count > 0 Then
                ' Display compilation errors.
                Console.WriteLine("Errors building {0} into {1}", _
                    sourceFile, cr.PathToAssembly)
                Dim ce As CompilerError
                For Each ce In cr.Errors
                    Console.WriteLine("  {0}", ce.ToString())
                    Console.WriteLine()
                Next ce
            Else
                Console.WriteLine("Source {0} built into {1} successfully.", _
                    sourceFile, cr.PathToAssembly)
                Console.WriteLine("{0} temporary files created during the compilation.", _
                        cp.TempFiles.Count.ToString())
            End If

            ' Return the results of compilation.
            If cr.Errors.Count > 0 Then
                Return False
            Else
                Return True
            End If
        End Function 'CompileCode

        <STAThread()> _
        Shared Sub Main()
            Dim exeName As String = "HelloWorld.exe"
            Dim provider As CodeDomProvider = Nothing

            Console.WriteLine("Enter the source language for Hello World (cs, vb, etc):")
            Dim inputLang As String = Console.ReadLine()
            Console.WriteLine()

            If CodeDomProvider.IsDefinedLanguage(inputLang) Then
                Dim helloWorld As CodeCompileUnit = BuildHelloWorldGraph()
                provider = CodeDomProvider.CreateProvider(inputLang)

                Dim sourceFile As String
                sourceFile = GenerateCode(provider, helloWorld)

                Console.WriteLine("HelloWorld source code generated.")

                If CompileCode(provider, sourceFile, exeName) Then
                    Console.WriteLine("Starting HelloWorld executable.")
                    Process.Start(exeName)
                End If
            End If

            If provider Is Nothing Then
                Console.WriteLine("There is no CodeDomProvider for the input language.")
            End If
        End Sub

    End Class
End Namespace

설명

개체는 CompilerParameters 인터페이스의 설정 및 옵션을 ICodeCompiler 나타냅니다.

실행 프로그램을 컴파일하는 경우 속성을 true로 설정 GenerateExecutable 해야 합니다. 가 로 GenerateExecutable 설정 false되면 컴파일러는 클래스 라이브러리를 생성합니다. 기본적으로 새 CompilerParameters 는 속성 GenerateExecutable 이 로 설정된 상태로 초기화됩니다 false. CodeDOM 그래프에서 실행 파일을 컴파일하는 경우 CodeEntryPointMethod가 그래프에 정의되어 있어야 합니다. 여러 코드 진입점이 있는 경우 클래스의 이름을 속성으로 설정하여 사용할 진입점을 정의하는 클래스 MainClass 를 나타낼 수 있습니다.

속성에서 출력 어셈블리 OutputAssembly 의 파일 이름을 지정할 수 있습니다. 지정하지 않으면 기본 출력 파일 이름이 사용됩니다. 생성된 어셈블리에 디버그 정보를 포함하려면 속성을 true로 설정합니다IncludeDebugInformation. 프로젝트에서 어셈블리를 참조하는 경우 어셈블리 이름을 컴파일을 호출할 ReferencedAssemblies 때 사용되는 의 속성에 대한 집합의 CompilerParameters 항목 StringCollection 으로 지정해야 합니다.

속성을 로 설정하여 디스크가 아닌 메모리에 기록되는 어셈블리를 GenerateInMemory 컴파일할 true수 있습니다. 어셈블리가 메모리에 생성되면 코드에서 CompilerResultsCompiledAssembly 속성을 통해 생성된 어셈블리에 대한 참조를 가져올 수 있습니다. 어셈블리가 디스크에 기록되는 경우 의 속성CompilerResults에서 생성된 어셈블리의 PathToAssembly 경로를 가져올 수 있습니다.

컴파일을 중단할 경고 수준을 지정하려면 컴파일을 중단할 경고 수준을 나타내는 정수로 WarningLevel 속성을 설정합니다. 속성을 로 설정 TreatWarningsAsErrors 하여 경고가 발생하는 경우 컴파일러를 구성하여 컴파일을 중지할 true수도 있습니다.

컴파일 프로세스를 호출할 때 사용할 사용자 지정 명령줄 인수 문자열을 지정하려면 CompilerOptions 속성에 문자열을 설정합니다. 컴파일러 프로세스를 호출하는 데 Win32 보안 토큰이 필요한 경우 UserToken 속성에 토큰을 지정합니다. 컴파일된 어셈블리에 .NET Framework 리소스 파일을 포함하려면 속성에 리소스 파일 EmbeddedResources 의 이름을 추가합니다. 다른 어셈블리에서 .NET Framework 리소스를 참조하려면 리소스 파일의 이름을 속성에 LinkedResources 추가합니다. 컴파일된 어셈블리에 Win32 리소스 파일을 포함하려면 속성에 Win32 리소스 파일 Win32Resource 의 이름을 지정합니다.

참고

이 클래스에는 모든 멤버에 적용되는 클래스 수준의 링크 요청 및 상속 요청이 포함됩니다. 직접 SecurityException 호출자 또는 파생 클래스에 완전 신뢰 권한이 없는 경우 가 throw됩니다. 보안 요청에 대 한 자세한 내용은 참조 하세요 링크 요청 하 고 상속 요청합니다.

생성자

CompilerParameters()

CompilerParameters 클래스의 새 인스턴스를 초기화합니다.

CompilerParameters(String[])

지정된 어셈블리 이름을 사용하여 CompilerParameters 클래스의 새 인스턴스를 초기화합니다.

CompilerParameters(String[], String)

지정된 어셈블리 이름 및 출력 파일 이름을 사용하여 CompilerParameters 클래스의 새 인스턴스를 초기화합니다.

CompilerParameters(String[], String, Boolean)

지정된 어셈블리 이름, 출력 이름 및 디버그 정보 포함 여부를 나타내는 값을 사용하여 CompilerParameters 클래스의 새 인스턴스를 초기화합니다.

속성

CompilerOptions

컴파일러를 호출할 때 사용할 선택적인 명령줄 인수를 가져오거나 설정합니다.

CoreAssemblyFileName

Object, String 또는 Int32와 같은 기본 형식을 포함하는 핵심 또는 표준 어셈블리의 이름을 가져오거나 설정합니다.

EmbeddedResources

어셈블리 출력을 컴파일할 때 포함할 .NET 리소스 파일을 가져옵니다.

Evidence
사용되지 않음.

컴파일된 어셈블리에 부여할 보안 정책 권한을 나타내는 증명 정보 개체를 지정합니다.

GenerateExecutable

실행 파일의 생성 여부를 나타내는 값을 가져오거나 설정합니다.

GenerateInMemory

출력을 메모리에 생성할지 여부를 나타내는 값을 가져오거나 설정합니다.

IncludeDebugInformation

컴파일된 실행 파일에 디버그 정보가 포함될지 여부를 나타내는 값을 가져오거나 설정합니다.

LinkedResources

현재 원본에서 참조되는 .NET 리소스 파일을 가져옵니다.

MainClass

기본 클래스의 이름을 가져오거나 설정합니다.

OutputAssembly

출력 어셈블리의 이름을 가져오거나 설정합니다.

ReferencedAssemblies

현재 프로젝트에서 참조하는 어셈블리를 가져옵니다.

TempFiles

임시 파일이 포함된 컬렉션을 가져오거나 설정합니다.

TreatWarningsAsErrors

경고를 오류로 간주해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

UserToken

컴파일러 프로세스를 만들 때 사용할 사용자 토큰을 가져오거나 설정합니다.

WarningLevel

컴파일러에서 컴파일이 중단되는 경고 수준을 가져오거나 설정합니다.

Win32Resource

컴파일된 어셈블리에 연결할 Win32 리소스 파일의 파일 이름을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상