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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:06:32+00:00 2026-05-20T08:06:32+00:00

I have been studying MSBuild as I have the need to automate my development

  • 0

I have been studying MSBuild as I have the need to automate my development shop’s builds. I was able to easily write a .BAT file that invokes the VS command prompt and passes my MSBuild commands to it. This works rather well and is kinda nifty.

Here is the contents of my .BAT build file:

call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
cd  C:\Sandbox\Solution
msbuild MyTopSecretApplication.sln /p:OutputPath=c:\TESTMSBUILDOUTPUT /p:Configuration=Release,Platform=x86
pause

^ This works well but I now have the need to use the MSBuild task for TeamCity CI. I have tried to write a few MSBuild scripts but I cannot get them to work the same. What is the equivalent build script to the command I am using in my .BAT file? Any ideas?

I have tried using something like this, but no success (I know this is wrong):

<?xml version="1.0"?>
<project name="Hello Build World" default="run" basedir=".">

<target name="build">
    <mkdir dir="mybin" />
    <echo>Made mybin directory!</echo>

  <csc target="exe" output="c:\TESTMSBUILDOUTPUT">
    <sources>
      <include name="MyTopSecretApplication.sln"/>
    </sources>
  </csc>
  <echo>MyTopSecretApplication.exe was built!</echo>
</target>

<target name="clean">
    <delete dir="mybin" failonerror="false"/>
</target>

<target name="run" depends="build">
  <exec program="mybin\MyTopSecretApplication.exe"/>
</target>

What I simply need is an MSBuild XML build script that compiles a single solution for Release mode to a specified output directory. Any help?

  • 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-20T08:06:32+00:00Added an answer on May 20, 2026 at 8:06 am

    Use the MSBuild task to build the solution passing the properties you need.

    <?xml version="1.0" encoding="utf-8"?>
    <Project
        xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
        ToolsVersion="4.0"
        DefaultTargets="Build">
    
        <PropertyGroup>
            <OutputDir>c:\TESTMSBUILDOUTPUT</OutputDir>
        </PropertyGroup>
    
        <ItemGroup>
            <ProjectToBuild Include="MySecretApplication.sln">
                <Properties>OutputPath=$(OutputDir);Configuration=Release</Properties>
            </ProjectToBuild>
        </ItemGroup>
    
        <Target Name="Build">
            <MSBuild Projects="@(ProjectToBuild)"/>
        </Target>
    
    </Project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have been trying to encrypt an xml file to a string so that I
I have been studying the ECMAScript specification and have found that it is extremely
I have been studying the modalforms & inline formsets but am not able to
I have been studying the database structure for shopping carts and notice that when
Have been studying the file system related classes of Adobe AIR 1.5, but so
Recently I have been studying recursion; how to write it, analyze it, etc. I
I have been studying c++ for an exam and I thought that i had
I am trying to teach ASP.NET MVC to students (undergrads) that have been studying
I have been studying python for quite sometime now and very recently I decided
I have been studying DDD in-depth on my own time; reading everything about it

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.