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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:34:52+00:00 2026-05-25T23:34:52+00:00

I am trying to specify some additional targets/tasks to an msbuild file by extending

  • 0

I am trying to specify some additional targets/tasks to an msbuild file by extending an existing msbuild file (a web applicartion .csproj file). The idea is to put configuration specific tasks in this “extended ms build file” and use this file in our build server (TeamCity). The way I tried to solve it at first was to add a folder “msbuildscripts” to my web project and put the extended ms build file there:

<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
  <Import Project="../My.Web.csproj" />
  ...more stuff...
</Project>

and then build this file using something like:

c:\myweb\msbuild.exe msbuildscripts/extended.msbuild.file.xml

Now, this wont work because when importing the original ms build file, that csproj file will be “executed” in the “wrong” folder (msbuildscripts), and the csproj-build-file wont find any of its referenced folders/items.

Is there any way to tell msbuild.exe to use a specific working directory? I know it is possible to solve this problem using an execute task, but that doesnt seem like a good solution.

  • 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-25T23:34:53+00:00Added an answer on May 25, 2026 at 11:34 pm

    Use MSBuild task like this:

    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="MyBuild">
    
    <ItemGroup>
     <ProjectToBuild Include="../My.Web.csproj" />
    </ItemGroup>
    
    <Target Name="MyBuild">
     <MSBuild Targets="Build" Projects="@(ProjectToBuild)"></MSBuild>
    </Target>
    </Project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to specify a relative directory in the web.xml file. I basically want
I am trying to automate some upload/download tasks from an ftp web server. When
I am currently trying to put together an URL where I specify some GET
I am trying to write some XML schema code to specify that a particular
I am trying to put together an index using terms, which I specify as
Just trying to specify some tables structures and models for Doctrine in a YAML
I am trying to do some basic file parsing within a directory in Python
I am trying to specify an alternative jre (my default is 1.6 and i
I've been trying to specify a dimension in pixels as a resource, so I
Using CSS, I'm trying to specify the height of a span tag in Firefox,

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.