V3 Documentation
Search

NCrunch Build Properties

When executing a build, in addition to the the $(NCrunch) environment variable, NCrunch always sets two environment variables that can be used to gain more information about the origin of the project being built. Because NCrunch's workspacing of projects effectively detaches them from their parent solution, these variables can be useful when implementing custom build processes that need to consider NCrunch's behaviour.

NCrunchOriginalSolutionDir

The $(NCrunchOriginalSolutionDir) property will always be set equal to the directory of the foreground solution open in Visual Studio, as opposed to $(SolutionDir), which NCrunch will set to the directory of the virtual solution within the project's workspace.

NCrunchOriginalProjectDir

The $(NCrunchOriginalProjectDir) property will always be set equal to the directory of the project file's original location in the foreground solution, as opposed to $(ProjectDir), which NCrunch will set to the directory of the virtual project within a workspace.