Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
/recurse (Find Source Files in Subdirectories)
Collapse the table of content
Expand the table of content

/recurse (Find Source Files in Subdirectories) (C# Compiler Options)

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

/recurse:[dir\]file

dir (optional)

The directory in which you want the search to begin. If this is not specified, the search begins in the project directory.

file

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.

This compiler option is unavailable in Visual Studio and 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

Community Additions

ADD
Show:
© 2015 Microsoft