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 303285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:10:28+00:00 2026-05-12T07:10:28+00:00

I have two questions re: visual studio 2008 and post-build events. 1) How do

  • 0

I have two questions re: visual studio 2008 and post-build events.

1) How do i dynamically list the msbuild.exe full path, to be called by the post-build event? Currently, i have the following (which works beautifully, btw):-

C:\Windows\Microsoft.NET\Framework64\v3.5\msbuild.exe 
    "$(ProjectDir)MSBuild\MSBuildSettings.xml"

.. but that would only work if u have a x64 bit environment. Is there a way to use some built in magic setting? eg. $(MsBuildPath)msbuild.exe "blah....xml" ??

2) My msbuild task does some stuff then generates a txt file as the output. I define the output path in the msbuild xml file as such..

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
    <UsingTask TaskName="CustomTask" AssemblyFile="MyAssembly.dll"/>
    <Target>
        <CustomTask
           ...
           OutputFile="Foo.txt"
        />
    <Target>
</Project>

How can i pass in the real output folder, to the msbuild file? I tried…

OutputFile="$(OutDir)Foo.txt"

but that failed 🙁

Cheers!

Update #1 – Answer to the second question..

I’ve figured out a way to answer the second question — not sure if it’s the best one though .. so I’m open to other ideas 🙂

XML file changes :: add a property group that sets the internal variable name IF no outside arguments were passed to the msbuild.exe executable.

    <PropertyGroup>
        <OutputFile Condition=" '$(OutputFile)'=='' ">
            ..\SomeFolder\Foo.txt</OutputFile>
    </PropertyGroup>

    <Target>
        <CustomTask
           ...
           OutputFile="$(OutputFile)"
        />
    <Target>
</Project>

Now, call the msbuild executable like …

msbuild.exe "C:\Temp Foo\Blah\MsbuildSettings" /p:OutputFile="C:\Folder 1\Folder 2\blah\"

and that works 🙂

  • 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-12T07:10:29+00:00Added an answer on May 12, 2026 at 7:10 am

    For question 1, use property MSBuildBinPath

    For question 2, use property OutputPath (C# or VB projects)

    OutputFile="$(OutputPath)Foo.txt"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have two services developed in Visual Studio .NET 2008 with VB.NET. Both were
I have two quick, easy questions on C# in Visual Studio. First, is there
I have two versions of Visual Studio 2005/208 installed in my system (windows7), when
I am building a game in Visual Studio 2008 and in order to build
In Visual Studio 2008 , the Exceptions window has two columns with check boxes:
IDE: Microsoft Visual Studio Professional 2008 Language: C# Background: I have one form and
Consider this synthetic example. I have two native C++ projects in my Visual Studio
I have this dataset created in Visual Studio 2008 in my project. I have
I have an ATL/WTL project developed using Visual Studio 2008 and up until now
I have a web application that I wrote in Visual Studio 2008 that targets

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.