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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:24:07+00:00 2026-05-23T10:24:07+00:00

I need to call exec and build a wix setup project. Currently I have

  • 0

I need to call exec and build a wix setup project.

Currently I have the following in my TFSbuild.proj

 <PropertyGroup>
      <WebRoot>$(DropLocation)\Latest\x86\Release\_PublishedWebsites\Web</WebRoot> 
      <DBRoot>$(DropLocation)\Latest\x86\Release\Database</DBRoot> 
    </PropertyGroup>

 <PropertyGroup>
      <Msbuildexe>&quot;msbuild&quot;</Msbuildexe>
      <Configuration>&quot;/p:Configuration:&quot;Release&quot;&quot;</Configuration>
      <DefineConstants>&quot; /p:DefineConstants:&quot;WebRoot=$(WebRoot);DBRoot=$(DBRoot)&quot;&quot;</DefineConstants>
      <WixSolution>&quot;$(MSBuildProjectDirectory)\Setup\Setup.sln&quot;</WixSolution>
    </PropertyGroup>

    <Message Text="Bulding setup solution" />
    <Message Text="$(Msbuildexe) $(Configuration) $(DefineConstants) $(WixSolution)" />
    <Exec Command="$(Msbuildexe) $(Configuration) $(DefineConstants) $(WixSolution)" />

I’ve tried to simply as much as possible so I don’t get confused where the ” are meant to be. When I run this the debug message (2nd last command) outputs

“msbuild”
“/p:Configuration:”Release”” ”
/p:DefineConstants:”WebRoot=\server\drops\app\Installer Build\Latest\x86\Release_PublishedWebsites\Web;DBRoot=\server\drops\app\Installer Build\Latest\x86\Release\Database””
“f:\builds\app\Installer Build\BuildType\Setup\Setup.sln”

And I get the following error in the log

‘”msbuild”‘ is not recognized as an
internal or external command,
operable program or batch file.
f:\builds\app\Installer
Build\BuildType\TFSBuild.proj(538,5):
error MSB3073: The command “”msbuild”
“/p:Configuration:”Release”” ”
/p:DefineConstants:”WebRoot=\server\drops\app\Installer Build\Latest\x86\Release_PublishedWebsites\Web;DBRoot=\server\drops\app\Installer Build\Latest\x86\Release\Database””
“f:\builds\app\Installer
Build\BuildType\Setup\Setup.sln””
exited with code 9009.

I’m not sure if this is being caused by not being able to call the msbuild command from the command line or a ” issue. If it is because I can’t call msbuild from the command line like this how would I go about referencing it, is there a property that points to it?

  • 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-23T10:24:08+00:00Added an answer on May 23, 2026 at 10:24 am

    To start with, you don’t need most of the quotes, especially if the paths you are using don’t contain spaces, but I’d trim it down to this, allowing for spaces in the paths for $(WebRoot), $(DbRoot) and $(MSBuildProjectDirectory):

    <PropertyGroup>
       <WebRoot>$(DropLocation)\Latest\x86\Release\_PublishedWebsites\Web</WebRoot>
       <DBRoot>$(DropLocation)\Latest\x86\Release\Database</DBRoot>
    </PropertyGroup>
    <PropertyGroup>
       <MsbuildExe>{still-needs-a-path-to}\msbuild</MsbuildExe>
       <Configuration>/p:Configuration:Release</Configuration>
       <DefineConstants>/p:DefineConstants:&quot;WebRoot=$(WebRoot);DBRoot=$(DBRoot)&quot;</DefineConstants>
       <WixSolution>&quot;$(MSBuildProjectDirectory)\Setup\Setup.sln&quot;</WixSolution>
    </PropertyGroup>
    <Message
       Text="Bulding setup solution"
       />
    <Message
       Text="$(MsbuildExe) $(Configuration) $(DefineConstants) $(WixSolution)"
       />
    <Exec
       Command="$(MsbuildExe) $(Configuration) $(DefineConstants) $(WixSolution)"
       />
    

    However, you still won’t be able to execute MSBuild with this, since the path to MSBuild isn’t specified. It is typically found in the $(WINDIR)\Framework\Microsoft.Net\v4.0.30319 folder. There are a few ways to get this, either encode it directly, rely on an environment variable (that has to be set up somehow), use the predefined $(MSBuildBinPath), or extract it from the registry using the MSBuild registry syntax, which would look like this:

    $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0\MSBuildToolsPath)
    

    However, it isn’t clear why you are running MSBuild using Exec rather than just using the MSBuild task. Change the line with Exec to this:

    <MSBuild
       Project="$(WixSolution)"
       Properties="$(DefineConstants)"
       />
    

    removing your declaration for <Configuration> and changing <DefineConstants> to this:

       <DefineConstants>Configuration=$(Configuration);WebRoot=$(WebRoot);DBRoot=$(DBRoot)</DefineConstants>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VB6 COM component which I need to call from my .Net
i have a php file from which i need to call a shell script
I have the following cUrl function call that is returning the response code. $result
I need to call into a Win32 API to get a series of strings,
I need to call a method that accepts a stream argument. The method loads
I need to call an external dll from c#. This is the header definition:
I need to call a VBScript file (.vbs file extension) in my C# Windows
I need to call a const function from a non-const object. See example struct
Say I need to call a javascript file in the <head> of an ERb
I'm working on a JSP where I need to call methods on object that

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.