Bagikan melalui


Build Page, Project Designer (C#)

Use the Build page of the Project Designer to specify the project's build configuration properties. This page applies to Visual C# projects only.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the active settings that you use determine these elements. This topic was written assuming that General Development settings have been selected. To view or change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings. For more information, see Visual Studio Settings.

Configuration and Platform

The following options enable you to select the configuration and platform to display or modify.

Note

With simplified build configurations, the project system determines whether to build a debug or release version. Therefore, these options are not displayed. To enable advanced build configurations, on the Tools menu, click Options. In the Options dialog box, expand Projects and Solutions, click General, and then select Show advanced build configurations. This gives you manual control over all configuration values and lets you choose whether a debug or release version is built. For more information, see General, Projects and Solutions, Options Dialog Box.

  • Configuration
    Specifies which configuration settings to display or modify. The settings can be Active (Debug) (this is the default), Debug, Release, or All Configurations.

  • Platform
    Specifies which platform settings to display or modify. The default setting is Active (Any CPU). You can change the active platform using the Configuration Manager. For more information, see How to: Create and Edit Configurations.

General

The following options enable you to configure general settings for the build process.

  • Conditional compilation symbols
    Specifies symbols on which to perform conditional compilation. Separate symbols with a space. For more information, see /define (Preprocessor Definition) (C# Compiler Options).

  • Define DEBUG constant
    Defines the DEBUG symbol. Selecting this is equivalent to using the /define:DEBUG command line option.

  • Define TRACE constant
    Defines the TRACE symbol. Selecting this is equivalent to using the /define:TRACE command line option.

  • Platform target
    Specifies the processor to be targeted by the output file. Select x86 for any 32-bit Intel-compatible processor, select Itanium for the Intel 64-bit Itanium processors. select x64 for other 64-bit processors, and select Any CPU to specify that any processor is acceptable. For more information, see /platform (Specify Output Platform) (C# Compiler Options).

  • Allow unsafe code
    Allows code that uses the unsafe keyword to compile. For more information, see /unsafe (Enable Unsafe Mode) (C# Compiler Options).

  • Optimize code
    Enable or disable optimizations performed by the compiler to make your output file smaller, faster, and more efficient. For more information, see /optimize (Enable/Disable Optimizations) (C# Compiler Options).

Errors and Warnings

The following settings are used to configure the error and warning options for the build process.

Treat Warnings as Errors

The following settings are used to specify which warnings are treated as errors. Select one of the following options to indicate under what conditions to return an error when the build encounters a warning. For more information, see /warnaserror (Treat Warnings as Errors) (C# Compiler Options).

  • None
    Treats no warnings as errors.

  • Specific warnings
    Treats the specified warnings as errors. Separate multiple warning numbers with a comma or semicolon.

  • All
    Treats all warnings as errors.

Output

The following settings are used to configure the output options for the build process.

  • Output path
    Specifies the location of the output files for this project's configuration. Note that the path is relative; if you enter an absolute path, it will be saved as relative. The default path is bin\Debug.

    With simplified build configurations, the project system determines whether to build a debug or release version. The Build command from the Debug menu (F5) will put the build in the debug location regardless of the Output path you specify. However, the Build command from the Build menu puts it in the location you specify. To enable advanced build configurations, on the Tools menu, click Options. In the Options dialog box, expand Projects and Solutions, click General, and then clear the Show advanced build configurations check box. This gives you manual control over all configuration values and whether a debug or release version is built. For more information, see General, Projects and Solutions, Options Dialog Box.

  • XML documentation file
    Specifies the name of a file into which documentation comments will be processed. For more information, see /doc (Process Documentation Comments) (C# Compiler Options).

  • Register for COM interop
    Indicates that your managed application will expose a COM object (a COM callable wrapper) that allows a COM object to interact with your managed application. The Output type property in the Application page of the Project Designer for this application must be set to Class Library in order for the Register for COM interop property to be available. For an example class that you might include in your Visual C# application and expose as a COM object, see Example COM Class (C# Programming Guide).

  • Generate serialization assembly
    Specifies whether the compiler will use the XML Serializer Generator Tool (Sgen.exe) to create XML serialization assemblies. Serialization assemblies can improve the startup performance of XmlSerializer if you have used that class to serialize types in your code. By default, this option is set to Auto, which specifies that serialization assemblies be generated only if you have used XmlSerializer to encode types in your code to XML. Off specifies that serialization assemblies never be generated, regardless of whether your code uses XmlSerializer. On specifies that serialization assemblies always be generated. Serialization assemblies are named TypeName.XmlSerializers.dll. For more information, see XML Serializer Generator Tool (Sgen.exe).

  • Advanced
    Click to display the Advanced Build Settings Dialog Box (C#) dialog box.

See Also

Other Resources

Projects, User Interface Elements

C# Compiler Options

Change History

Date

History

Reason

September 2009

Updated description for Generate Serialization Assembly

Content bug fix.