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

  • Home
  • SEARCH
  • 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 143065
In Process

The Archive Base Latest Questions

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

Summary: How do I expand a property with value download\${bulidmode}\project\setup.msi to download\Debug\project\setup.msi if the

  • 0

Summary:

How do I expand a property with value ‘download\${bulidmode}\project\setup.msi’ to ‘download\Debug\project\setup.msi’ if the property buildmode contained debug so I can use it as the file=” part of < copy >

Detail:

I have a bit of a requirement to be able to expand properties within a string in nant.

For example I have a target that is copying file A to B. A and B both come from a simple two field CSV file which I’m iterating through using

<foreach item='Line' in='filelist.csv' delim=',' property='source.file,target.file'>      <property name='sourcefile' value='${path::combine(source.dir,source)}' />      <property name='targetfile' value='${path::combine(download.dir,destination)}' />     <echo message='Copy ${sourcefile} to ${targetfile}' />      <copy file='${sourcefile' tofile='${destination}' />  </foreach> 

and the filelist.csv will be

build\manifest.xml  solutiondirectory\setup-proj-directory\Release\setupproj.msi,ProductA\ProductA.msi solutiondirectory\another-proj-dir\Release\setupproj.msi,ProductB\ProductB.msi 

(The reason we split these out is that we write multi-tiered applications and deploy by MSI to each tier – so one product has multiple msi’s all built with the same version numbers)

Anyway – I want to change this to that I no longer have ‘Release’ in the filelist.csv file but something like ${build.mode}. I would wrap the above code with a

<foreach item='String' in='Release,Debug' delim=',' property='build.mode'> ....as above </foreach> 

and the property embedded within the string in the file gets expanded.

I’ve been beating my head against a brick wall for a few hours, but just can’t figure it out.

Thanks

  • 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:02:11+00:00Added an answer on May 11, 2026 at 8:02 am

    It is possible with a custom function :

    <?xml version='1.0'?> <project>     <script language='C#' prefix='vbfox' >         <code>             <![CDATA[             [Function('expand')]             public string ExpandString(string str)             {                 return Project.Properties.ExpandProperties(str, Location.UnknownLocation);             }             ]]>         </code>     </script>     <property name='hello' value='{path::combine('_hello_', '_world_')}' />     <property name='hello' value='${'$' + hello}' />     <echo message='${hello}' />     <echo message='${vbfox::expand(hello)}' /> </project> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 240k
  • Answers 240k
  • 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 You'll need to atomicize your operation of "adding objects to… May 13, 2026 at 7:12 am
  • Editorial Team
    Editorial Team added an answer html, body, object { margin: 0; padding: 0; border: 0;… May 13, 2026 at 7:12 am
  • Editorial Team
    Editorial Team added an answer Try installing the Visual C++ 2008 Redistribuable Package or Visual… May 13, 2026 at 7:12 am

Related Questions

I've found a lot of different examples on the internet, but nothing seems to
I am looking for a way to show additional information (columns) when doing subtotals
Executive summary: how do I install a new root certificate into Java using Java
I am using WWW::Mechanize and currently handling HTTP responses with the ' Content-Encoding: gzip

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.