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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:29:00+00:00 2026-05-11T05:29:00+00:00

I’m rewriting our NAnt build scripts to make them cleaner and simpler, as well

  • 0

I’m rewriting our NAnt build scripts to make them cleaner and simpler, as well as more general purpose.

One of the steps in our build process is to package certain files into a zip file. Before we had created a fileset with lots of included file types, trying to catch everything that might be in the project. This occasionally caused problems when we wanted to include a non-standard file type with the project.

I was hoping that I could find a way to create a fileset based on the files (and, also, a subset of the files) listed in the Visual Studio project file (.csproj). I could then use this fileset in a zip task. I haven’t found anything that does this automatically (though the now-deprecated SLiNgshoT task in NAntContrib looked a little promising).

I started down the path of trying to do this manually, but have gotten stuck. I have a target that gets the project from the solution (using regex), then tries to get each Content file in the project using xmlpeek (with the XPath query /n:Project/n:ItemGroup/n:Content/@Include). The problem here is that xmlpeek doesn’t return every value, just the first. And, even if it did return every value, I’m not sure how I’d get it into a fileset from here.

Is there any way to salvage this track of thinking? Can I accomplish what I want with a custom NAnt task (I’d prefer not to have every project dependent on a custom task)? Is there some built-in way to do this that I’m not finding?

Please feel free to ask questions in the comments if something about my goal or method isn’t clear.

Thanks!


UPDATE: To clarify, my point in all of this is to make the whole process much more seamless. While I can easily add all .xml files to a package, this often gets .xml files that live in the same folder but aren’t really part of the project. When I already have a list of the files that the project uses (separated out between Content and other types, even), it seems a shame not to use that information. Ultimately, no one should have to touch the build file to change what gets included in a package. It doesn’t seem like too much of a pipe dream to me…

  • 1 1 Answer
  • 1 View
  • 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-11T05:29:01+00:00Added an answer on May 11, 2026 at 5:29 am

    See this related question. The microsoft.build.buildengine interface should let you get much better access to the information you need, but unfortunately I think you would have to build a custom task.

    But I think that parsing a project file to generate a fileset that is used elsewhere is … a bit much to put all inside your build script. And since you seem to want to re-use this, I don’t think that depending on a custom task is any worse than any other form of re-use (even if you can do it all in existing Nant tasks, you’d still need to have every project inherit that process somehow).

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

Sidebar

Related Questions

No related questions found

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.