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

Related Questions

Summary: Can I program a thick client game in C without reinventing wheels ,
Summary: I'm able to compile a RAD Studio 2009 project using MSBuild on a
Summary: How can I create a singleton mixin in C++? I am trying to
Summary: Can i get registry creation, modification, and last write times like i can
Summary: I have a struct that is read/written to file. This struct changes frequently,
Summary: Say I have a project in Django called devsite which will be deployed
Summary Hi All, OK, further into my adventures with custom controls... In summary, here
Summary What's the best way to ensure a table cell cannot be less than
SUMMARY: When browsing an ASP.NET website using Windows Explorer, popup windows do not borrow
Summary: I'm developing a persistent Java web application, and I need to make sure

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.