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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:45:55+00:00 2026-05-27T18:45:55+00:00

My custom NAnt task relies on a certain fileset. It is considered to be

  • 0

My custom NAnt task relies on a certain fileset. It is considered to be defined by the time the task executes. I’d like to make sure fileset was defined before using it. I’m thinking of something similar to property::exists('property').

I failed to find the appropriate function.
Is it possible with NAnt (or NAntContrib) out of the box?

  • 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-27T18:45:56+00:00Added an answer on May 27, 2026 at 6:45 pm

    Generally, tasks should not depend on filesets or properties. Instead, they should take explicit parameters. An existing fileset can be reused using refid, so there’s no redeclaration resulting from this. Example syntax:

    <myTask><filesetParameter refid="compileUs"/><myTask>
    

    If the referenced fileset is not defined, NAnt will throw an exception – this is proper (expected) behaviour, as the build cannot continue at this point.

    Inside your task, the property would be defined as follows:

    [TaskName("myTask")]
    public class MyTask : Task
    {
      [TaskAttribute("filesetParameter", Required = true)]
      public FileSet FilesetParamter
      { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using nant to build our product and have written a custom task to
I have a custom NAnt task, which writes to console like this: Console.WriteLine(Status message:
I have custom NAnt task for test purposes and I would like to cancel
I'm in the process of writing a custom task for NAnt. I've been basing
Is there a relatively simple way in nant, without writing a custom task, to
I would like to modify the string in a .h file with NAnt before
the custom cursor is a sprite. using it to click another sprite no longer
1) Custom exceptions can help make your intentions clear. How can this be? The
I've been using MonoDevelop and Make to execute some build taks on a C
My custom capistrano task app:sample fails with the following error message: mnylen ilmo-on-rails $

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.