Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7564241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:51:38+00:00 2026-05-30T13:51:38+00:00

In my csproj file, I have a different build path. <BaseIntermediateOutputPath>C:\Temp\Build\MyProject</BaseIntermediateOutputPath> When in the

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:51:39+00:00Added an answer on May 30, 2026 at 1:51 pm

    I had a similar requirement and using $(MSBuildProjectName) did the job for me.

      <PropertyGroup>
        <ProjectView>ProjectFiles</ProjectView>
        <BaseIntermediateOutputPath>R:\$(MSBuildProjectName)\obj\</BaseIntermediateOutputPath>
      </PropertyGroup>
    

    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

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colVolumes = objWMIService.ExecQuery _
        ("Select * from Win32_Volume") Where Label = 'RAMDISK'")
    For Each objVolume in colVolumes
        objVolume.DriveLetter = "R:"
        objVolume.Put_
    Next
    

    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:

    1. Reserved properties: http://msdn.microsoft.com/en-us/library/ms164309%28loband%29.aspx
    2. Changing drive letters: http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/disk/drives/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have AssemblyInfo.cs file automatically generated during build. Here's part of .csproj file: <PropertyGroup>
I have an project csproj, with app.config file, and logging Ent.Library section using configsource
I have included custom code into csproj file which Zip the whole project on
I'm attempting to setup a .csproj file to have a conditional item group which
Based on question : Reading a *.CSPROJ file in C# I have code to
I have a csproj file which references a shared MSBuild script with an <Import>
Is there a way to compile a .vbproj or .csproj project file directly, just
I have a C# Visual Studio project (.csproj) that has a reference to the
When i build a A.sln which includes 2 projects B.csproj and C.csproj which has
We have 3 years old solution (.sln) with about 20 projects (.csproj). It is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.