/recurse (Find Source Files in Subdirectories)
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

/recurse (Find Source Files in Subdirectories)



dir (optional)
The directory in which you want the search to begin. If this is not specified, the search begins in the project directory.
The file(s) to search for. Wildcard characters are allowed.


The /recurse option lets you compile source code files in all child directories of either the specified directory (dir) or of the project directory.

You can use wildcards in a file name to compile all matching files in the project directory without using /recurse.

To set this compiler option in the Visual Studio development environment

This compiler option is unavailable in Visual Studio.

To set this compiler option programmatically

This compiler option cannot be changed programmatically.


Compiles all C# files in the current directory:

csc *.cs

Compiles all of the C# files in the dir1\dir2 directory and any directories below it and generates dir2.dll:

csc /target:library /out:dir2.dll /recurse: dir1\dir2\*.cs

See Also

C# Compiler Options

© 2015 Microsoft