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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:17:29+00:00 2026-05-26T20:17:29+00:00

Strange way to put a question, anyway … Basically this is my first real

  • 0

Strange way to put a question, anyway … Basically this is my first real attempt with MSBuild.

I managed to create a Target (RenameJs) which produces a new Output Items List named JsMinifyOutput (a renamed version of another input list).

Then, in a dependent Target (ClosureCompile) I’m trying to actually use the previously generated Output list. I have a Message Task as the following, where I can see the Output List values printed on the console:

    <Message Text="Outputs: %(JsMinifyOutput.FullPath)" />

But then, in the same dependent Target, when I try to use the Output List in the actual Exec Task, the list seems to be empty. The following task:

<Exec Command="$(ClosureCompilerCmd) --js %(JsMinify.FullPath) --js_output_file %(JsMinifyOutput.FullPath)" />

appears on the console as just:

java -jar Some\Path\To\SomeInputFile.debug.js --js_output_file

while I would expect something like:

java -jar Some\Path\To\SomeInputFile.js --js_output_file Some\Path\To\SomeFileRenamed.js

If I try with this simple Exec Task, it properly shows all file names:

<Exec Command="echo %(JsMinifyOutput.FullPath)" />

What I am trying to achieve here is the following: starting from an input ItemGroup list, create another (output) ItemGroup list by means of some transformation over the former (e.g. renaming, replacing text, …). Then, having this two ItemGroup lists, loop over them in parallel so to say, and perform an Exec task over them. In pseudo-language, something like:

 for(i from 0 to inList.length)
 {
   Exec Command="Path\To\Some\Command --in inList[i] --out outList[i]
 } 

Am I doing something completely silly here?
PS: This is with Build Engine Version 4.0, .NET Framework Version 4.0

  • 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-26T20:17:30+00:00Added an answer on May 26, 2026 at 8:17 pm

    Uhm, it seems that Exec Task cannot iterate over two parallel ItemGroups at the same time. … At least that is what a MSBuild guru answers here:

    The problem is that you are batching on 2 items at a time.

    I’m not totally sure if what I’m trying to do here is “batching on 2 items at a time”.

    EDIT

    Having cleared what’s the actual reason for the task not working, here’s my approach to (what I think is) a clean solution:

    1. Add a new metadata to the existing input ItemGroup. That metadata is the calculated output path and takes the place of the former output ItemGroup. Inside the metadata you find the filepath transformation (rename, replace, …) achieved somehow (through Inline Task, Property Function, Transform, you name it).
    2. Reference the new metadata where the former output ItemGroup was used, e.g. within Exec Command attribute, or within the Target Outputs attribute.

    By way of an example:

    <Target Name="JsRename"> <!-- This adds the metadata -->
      <ItemGroup>
        <JsMinify>
          <OutputPath>[do something over %(FullPath)</OutputPath>
        </JsMinify>
      </ItemGroup>
    </Target>
    <Target Name="ClosureCompile" DependsOnTargets="JsRename"> <!-- Here is the actual task -->
      <Exec Command="$(ClosureCompilerCmd) --js %(JsMinify.FullPath) --js_output_file %(JsMinify.OutputPath)" />
    </Target>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm hacking my way through learning Flex and have found some strange behaviour. When
Friends, I have a strange need and cannot think my way through the problem.
Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central
Strange program hang, what does this mean in debug? After attaching windbg I found
Strange one this, which isn't programming related directly, but I thought it important to
Strange... When i create an HREF to a .doc, the browser behaves correctly and
Strange.. with my installation of the Zend Framework <?php echo $this->user; ?> works fine
I am asking because the way I have it right now seems really strange.
I have a problem so strange that I hardly can put an adequate title
This question is related to another question I asked. In my other question 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.