V3 Documentation
Search

NCrunch Build Properties

When executing a build, in addition to the the $(NCrunch) environment variable, NCrunch always sets several 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.

NCrunchOriginalSolutionPath

The $(NCrunchOriginalSolutionPath) property will always be set equal to the full path of the foreground solution open in Visual Studio. Example: C:\Projects\MySolution\MySolution.sln

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. Example: C:\Projects\MySolution\

NCrunchOriginalSolutionName

The $(NCrunchOriginalSolutionName) property will always be set equal to the file name of the foreground solution open in Visual Studio. Example: MySolution.sln

NCrunchOriginalProjectPath

The $(NCrunchOriginalProjectPath) property will always be set equal to the full path of the project file's original location in the foreground solution. Example: C:\Projects\MySolution\MyProject\MyProject.csproj

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. Example: C:\Projects\MySolution\MyProject\