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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:37:22+00:00 2026-06-07T15:37:22+00:00

Can the Albacore nuspec task resolve all needed dependencies for a solution? When I

  • 0

Can the Albacore nuspec task resolve all needed dependencies for a solution? When I have several projects with changing dependencies it takes a lot of effort to keep the rakefile up to date. Can this be automated?

desc 'create the nuget package'
nuspec do |nuspec|
   nuspec.id = 'myprojectid'
   nuspec.version = '1.2.3'
   nuspec.authors = 'Jon Jones'
   nuspec.description = 'my-project is a collection of utilties'
   nuspec.title = 'my-project'
   nuspec.dependency <magic here>
end

A manual solution would be to go through the packages files and resolve this by hand. Has anyone written up anything automated?

  • 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-06-07T15:37:24+00:00Added an answer on June 7, 2026 at 3:37 pm

    I realize this is an old question, but seeing as it doesn’t have an answer, this might help someone looking for the same thing. I’m currently working on some Rake Tasks to further automate the creation of nuspec files in a conventional/autonomous way, so I’ll update this post later with the final solution.

    To answer the question at hand though, here’s a little ruby function that will pull dependencies out of the packages.config file for a given project in the solution.

    def GetProjectDependencies(project)
        path = "#{File::dirname project.FilePath}/packages.config"
        packageDep = Array.new
    
        if File.exists? path
            packageConfigXml = File.read("#{File::dirname project.FilePath}/packages.config")
            doc = REXML::Document.new(packageConfigXml)
            doc.elements.each("packages/package") do |package|
                dep = Dependency.new
                dep.Name = package.attributes["id"]
                dep.Version = package.attributes["version"]
                packageDep << dep
            end
        end
    
        packageDep
    end
    

    And the Dependency class used:

    class Dependency
        attr_accessor :Name, :Version
    
        def new(name, version)
            @Name = name
            @Version = version
        end
    end
    

    This method takes in a “project” instance, and grabs the dependency/versions from the package.config file for that project.

    As I said, I’ll post a more complete solution soon, but this is a good starting point for anyone if they need it.

    EDIT: Sorry it took me so long to post the final version of this, but here’s a link to the gist containing the sample code I’m currently using for a number of projects.

    https://gist.github.com/4151627

    Basically, I wrap the data in a “Project” class, and populate dependencies from package.config. As a bonus, it also adds dependencies from interproject references (parses the project file). The classes/logic is there, as well as a sample nuspec task.

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

Sidebar

Related Questions

I have been playing around with Rake and Albacore, to see if I can
Can I order my users in the database, so I don't have to say
Can anyone provide the XAML for creating customized check boxes. I have attached the
Can someone guide me on a possible solution? I don't want to use /bin/cp
Can't figure out how to do this in a pretty way : I have
Can anyone please advice how can I have value of i in the following
I'm working on rake tasks for a large .net solution (using the albacore gem)
Can you have submenus with the top level set to checkable in WPF? I
Can we close all known/unknown connections to database with the code? I'm using Access
Can we write all the control events in a seperate class file in different

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.