Specifying Compiler Directives for the Open Folder Mode

When files are opened in Visual Studio using File > Open > Folder, you can specify Compiler directives for them at folder or file level.

Any properties you set on folder level override the workspace properties. Respectively, any properties you set on individual file level will override the properties specified at folder level.

To specify any properties at folder level:

  1. Right-click the folder in Solution Explorer and click Properties.

To specify properties at file level:

  1. Right-click the file in Solution Explorer and click Properties.

You can use the Determine Directives command but this works differently to how it works with projects:

  1. Right-click the file in Solution Explorer and click Determine Directives.

    This resets the directives for the file and sets any directives that are found in an associated .idy file.