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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:48:58+00:00 2026-05-11T08:48:58+00:00

I created a build.proj file which consists of a task to copy files that

  • 0

I created a build.proj file which consists of a task to copy files that will be generated after the build is complete. The problem is that these files are not copied the first time round and I have to run msbuild again on the build.proj so that the files can be copied. Please can anyone tell me whats wrong with the following build.proj file:

<Configuration Condition=''$(Configuration)' == '''>Debug</Configuration>  <SourcePath Condition=''$(SourcePath)' == '''>$(MSBuildProjectDirectory)</SourcePath>   <BuildDir>$(SourcePath)\build</BuildDir>  </PropertyGroup>   <ItemGroup>      <Projects         Include='$(SourcePath)\src\myApp\application.csproj'>       </Projects>  </ItemGroup>   <Target Name='Build'>    <Message text = 'Building project' />        <MSBuild         Projects='@(Projects)'       Properties='Configuration=$(Configuration)' />  </Target>  <ItemGroup>    <OutputFiles Include ='$(MSBuildProjectDirectory)\**\**\bin\Debug\*.*'/> </ItemGroup>  <Target Name='CopyToBuildFolder'>    <Message text = 'Copying build items' />    <Copy SourceFiles='@(OutputFiles)' DestinationFolder='$(BuildDir)'/> </Target>  <Target Name='All'    DependsOnTargets='Build; CopyToBuildFolder'/>  </Project>  
  • 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. 2026-05-11T08:48:59+00:00Added an answer on May 11, 2026 at 8:48 am

    The itemgroups are evaluated when the script is parsed. At that time your files aren’t there yet. To be able to find the files you’ll have to fill the itemgroup from within a target.

      <!-- SQL Scripts which are needed for deployment -->   <Target Name='BeforeCopySqlScripts'>     <CreateItem Include='$(SolutionRoot)\04\**\Databases\**\*.sql'>       <Output ItemName='CopySqlScript' TaskParameter='Include'/>     </CreateItem>   </Target> 

    This example creates the ItemGroup named ‘CopySqlScript’ using the expression in the Include attribute.

    Edit:

    Now I can read your script: add the CreateItem tag within your CopyToBuildFolder target

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In MsBuild it is possible to create a build.proj.user file which is parsed by
I have a big project here where I created some build files which I
I have created a build task in vs2012. I ran it. It complains that
So I set up a new project into Eclipse and created a build.xml that
I have created an exe file as a part of pre build event. I
I'm attempting to build some dynamic menus that are created on the fly by
I want to build a Brainfuck (Damn that name) interpreter in my freshly created
I have created custom build tasks in my project file to run my nUnit
I have created build script in search way it will place all project dependencies
I have created a build definition variable which should contain my AssemblyInfo version. I

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.