In my csproj file, I have a different build path.
<BaseIntermediateOutputPath>C:\Temp\Build\MyProject</BaseIntermediateOutputPath>
When in the prebuild and post build events, I have access to certain macro variables.
$(OutDir)
$(ProjectName)
$(ProjectPath)
$(SolutionDir)
Can I use those variables within my csproj?
For example, I tried the following without success.
<BaseIntermediateOutputPath>C:\Temp\Build\$(ProjectName)</BaseIntermediateOutputPath>
I had a similar requirement and using $(MSBuildProjectName) did the job for me.
Here R: is my RAMDISK drive letter.
For others who may also face issues in setting up the RAMDISK drive letter correctly, I used a simple VBS script
This ensures that any drive loaded with the label RAMDISK is set to R: drive instead of the default drive that appears. While this is not part of your Q, I am sure that this will be handy to others who have similar requirements of using the RAMDISK for their obj files and find the case of changing drive letters in vbproj/csproj files cumbersome.
References: