We are using
$(MSBuildThisFileDirectory) like in this example from MSDN:
http://msdn.microsoft.co...s/library/dd633440.aspx
Quote:<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), EnlistmentInfo.props))\EnlistmentInfo.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), EnlistmentInfo.props))' != '' " />
It's used to walk up the directory tree to find the marker file, and allows you to keep your project files at an arbitrarily depth.
But NCrunch build will give an error such as:
The expression "[MSBuild]::GetDirectoryNameOfFileAbove('', EnlistmentInfo.props)" cannot be evaluated. The path is not of a legal form.I changed
$(MSBuildThisFileDirectory) to
$(MSBuildProjectDirectory) and it worked (after I also added the actual file and the directory to AdditionalFilesToCopy).
This seems like a straightforward bug - maybe because this property is newish (it was not documented for VS2010).
Note MSBuildProjectDirectory will not work as a substitute to MSBuildThisFileDirectory in all cases, so my workaround is limited.
Hopefully future versions of NCrunch will support MSBuildThisFileDirectory.
Leonid