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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:39:40+00:00 2026-05-12T10:39:40+00:00

I made a custom task in my TFS build to examine my project’s GlobalAssemblyInfo.cs

  • 0

I made a custom task in my TFS build to examine my project’s GlobalAssemblyInfo.cs file in order to extract an attribute (AssemblyInformationalVersion to be exact) in order to use its value in naming a zip file that I make with the build.

<UsingTask TaskName="GetAssemblyInformationalVersion.GetAssemblyInformationalVersionTask"
         AssemblyFile="$(MSBuildExtensionsPath)\GetAssemblyInformationalVersion.dll" />

The .cs file for my DLL has these two properties:

[Required]
public String InfoFile { get; set; }
public String InfoVersion { get; set; }

Here is my call to my task:

<GetAssemblyInformationalVersionTask InfoFile="$(Path to file)\GlobalAssemblyInfo.cs" />

My intention is to pass in the assembly info file through the property InfoFile so that I can find what I want (which my C# code does) and set it to the property InfoVersion for me to reference in TFS by running it as a task. In principle, I would use the property InfoVersion to use in naming my zip file. For example,

"Package.$(some form of reference to InfoVersion).zip"

However, I have not been able to find a way to actually accomplish this.

My question is: How can I invoke the get part of my property in my task? It seems like it should be easy, since I have not found anything written about this sort of thing online, but any help will be much appreciated.

  • 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-12T10:39:40+00:00Added an answer on May 12, 2026 at 10:39 am

    Your custom task, GetAssemblyInformationVersionTask, will need to have a property on it of type ITaskItem that is decorated with the [Output] attribute.

    public class GetAssemblyInformationVersionTask
    {
        [Output]
        public ITaskItem Version { get; set; }
    
        public override bool Execute()
        {
          // code to set Version 
          return true;
        }
    }
    

    Then you will be able to use it like so:

    <GetAssemblyInformationVersionTask InfoFile="$(Path to file)\GlobalAssemblyInfo.cs">
            <Output TaskParameter="Version" ItemName="AssemblyVersion" />
     </GetAssemblyInformationVersionTask>
    

    AssemblyVersion will be the item variable that will contain the value of the Version property of your task.

    If you’ve not seen it, MSDN Best Practices for Reliable Builds, Part 2 touches on the subject of output parameters. I’ll see if I can’t find better examples online.

    Thomas Ardal has another good sample of [Output] in a custom task here.

    HTH,

    Z

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

Sidebar

Related Questions

I have made custom attribute in my asp.net mvc2 project: [AttributeUsage(AttributeTargets.Property, AllowMultiple = false,
I made a custom master page. I also made a custom CSS file, which
I made a custom Static Library that I use in an iOS project. When
I've made custom adapter and call notifyDataSetChanged() then data updates. But after call notifyDataSetChanged()
Made a custom obj called Item with some string fields and one float. .h
I made a custom control that is basically a multiline TextBox that allows input,
I made a custom UITableView subclass and implemented this: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { //
I made a custom handler that derives from MvcHandler. I have my routes using
I made an custom UITableView. Then I made a custom header for sections. It
I made a custom Listview (Without overriding getView() method) with each item in a

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.