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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:05:59+00:00 2026-05-19T01:05:59+00:00

I apologize in advance for not even knowing how to correctly phrase what I

  • 0

I apologize in advance for not even knowing how to correctly phrase what I need, so I’ll try and explain this in more detail:

We are building an automated deployment process using MSBuild. Our software installer needs to be run multiple times on some machines in our environment as we have to set up separate instances. The way we’re doing this is by creating ‘lists’ (if that’s the correct term, variables like @(name)) of tasks to be completed with metadata describing the install to run, for which instance to run it, and on what machine, and then cycling through all of those. In addition, we’re shutting down and restarting services in a synchronized way.

Essentially, our problem lies in wanting to split out where failures are and restricting them to a specific instance for the purposes of our logger. Is there any way that the current task’s properties are exposed to the logger when warnings are raised? Ideally (for this to be of any use) it would be post-parsing, so if the property is:

<Exec Command="install%(InstanceName.ShortName).bat" />

Can we look into that property in a logger and see that currently it’s running ‘installfoo.bat’?

  • 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-19T01:06:00+00:00Added an answer on May 19, 2026 at 1:06 am

    The feature you’re describing is called batching. If I’m reading your question correctly, you want to be able to log what batch the build is on when an error, or some other event, occurs.

    Looking at the ILogger interface I don’t think it can be done – only the task knows what batch of items has been passed to it. I’m guessing you want to do this for a bunch of different built-in tasks, so one workaround would be to wrap the task in a target where you can log whatever you like.

    <Project xmlns=...>
        <Target Name="Build">
            <ItemGroup>
                <InstanceName Include="Foo Instance">
                    <ShortName>foo</ShortName>
                </InstanceName>
                <InstanceName Include="Bar Instance">
                    <ShortName>bar</ShortName>
                </InstanceName>
            </ItemGroup>
    
            <MSBuild Projects="$(MSBuildProjectFile)"
                     Targets="BatchedExec"
                     Properties="CurrentInstance=%(InstanceName.Identity);
                         CurrentShortName=%(ShortName)">
            </MSBuild>
        </Target>
    
        <Target Name="BatchedExec">
            <Message Text="CurrentInstance: $(CurrentInstance)" />
            <Message Text="CurrentShortName: $(CurrentShortName)" />
    
            <Exec Command="install$(CurrentShortName).bat">
                <Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
            </Exec>
    
            <Message Text="install$(CurrentShortName).bat exited with code $(ExitCode)." />
        </Target>
    </Project>
    

    In this example, the BatchedExec target is called for each batch, and you can log whatever information you like before you call the task. You’d make similar targets for each task you wanted to run with batched arguments.

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

Sidebar

Related Questions

I apologize in advance for not knowing how to better state this question. In
I apologize in advance if this is too long. I figure more detail is
First off, I'd like to apologize in advance for not knowing this. I've been
I apologize in advance if this has been addressed, but I have not found
I'd like to apologize in advance, because this is not a very good question.
In advance, I apologize if the question title may not be be convenient. I'm
I'm not so savvy with MYSQL, so my apologies in advance is this is
I apologize in advance, if this question doesn't make sense. I'm a newbie. I
I apologize in advance if this question seems confused. The behaviour I am seeing
I apologize in advance; this is a long question. I've tried to simplify as

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.