This documentation is archived and is not being maintained.

/incremental (Enable Incremental Compilation)

Visual Studio .NET 2003
/incremental[+ | -]


The /incremental compiler option enables the incremental compiler, which compiles only those methods that have changed since the last compilation. Information about the state of the previous compilation is stored in the following files, which are created by the compiler:

When compiling with /debug, the status of debug information is stored in the program database (.pdb file).
Information about the status of the compilation, other than debug information, is stored in a .incr file.

The first time you use /incremental, the .incr and .pdb files are updated and all subsequent compilations will be incremental. Changing the compiler options from the previous /incremental compilation will cause a full rebuild of the .incr and .pdb files.

If the compiler detects many changes since the last incremental build, it may perform a full build, as a full build would be at least as efficient as an incremental build. If the compiler cannot find the project's .pdb or .incr files, a full rebuild will occur.

In an incremental build, /doc is ignored. To ensure that your documentation file is up to date, build with /incremental-.

By default, /incremental- is in effect. Specifying /incremental is the same as specifying /incremental+.

Output files created with the /incremental option may be larger than those created with incremental compilation disabled. Because the output files can be larger, you should use /incremental- in the final build of your output file.

/incremental will speed compilation on projects with many, smaller files, and will have little or no speed improvement on projects with fewer, large files.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
  2. Click the Configuration Properties folder.
  3. Click the Advanced property page.
  4. Modify the Incremental build property.

To set this compiler option programmatically

See IncrementalBuild Property.


Compile in.cs using the incremental compiler:

csc /incremental in.cs

See Also

C# Compiler Options