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

Ask A Question

Stats

  • Questions 143k
  • Answers 143k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Though it would be great if someone could confirm it.… May 12, 2026 at 8:29 am
  • Editorial Team
    Editorial Team added an answer Calling Add() on a cache eventually calls an internal method… May 12, 2026 at 8:29 am
  • Editorial Team
    Editorial Team added an answer Check out ELMAH (Error Logging Modules and Handlers). May 12, 2026 at 8:29 am

Related Questions

I have a problem with a newly installed Visual Studio 2008 (new pc) and
After installing TortoiseSVN 1.6.0, all files loaded into an AnkhSVN enabled Visual Studio 2008
Background I am using interface-based programming on a current project and have run into
This morning, when I tried to add a new ASPX page to my project,
In a desktop application needing some serious re-factoring, I have several chunks of code

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.