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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:27:41+00:00 2026-06-13T23:27:41+00:00

For a github hosted open sourced C# project which is also available via NuGet,

  • 0

For a github hosted open sourced C# project which is also available via NuGet, how should one organize the source? Specifically:

  • should the .nuspec file be in the github repository?
  • should the .nuspec file be in the same folder as the .csproj file?
  • how about the NuGet package tree (the /lib, /content stuff), since is generated, should it be in git?

My thinking is that the NuGet part is separate from the github hosting, as in the project source are available but the .nuspec is not, since the publishing in NuGet is not an open source operation per-se. None wants that every fork to build and publish a new NuGet package, so that the open source Foo package ends up in the gallery as ‘Rick’s Foo’ vs. ‘John’s Foo’ vs. ‘Alice’s Foo’ etc.

But on the other hand I do want the github source depot to act as a one-stop repository for the project, if I open my other laptop and enlist from there, I should be able to build/package/push w/o recreating the whole NuGet infrastructure from scratch (ie. only enter my API key, nothing more).

These two requirements are contradicting each other, Did I miss something obvious?

  • 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-13T23:27:42+00:00Added an answer on June 13, 2026 at 11:27 pm

    I would do the following:

    • Commit the .nuspec file next to the .csproj file
    • Add a nuget.config file which moves the packages folder a level up.
    • Enable package restore in the solution and do NOT commit the content of the NuGet package repository
    • Create an msbuild file (or whatever build vehicle you like) which has:
      • a “build” target which builds the source and creates the nuget package
      • a “publish” target which pushes the NuGet package to nuget.org and takes your API key as a parameter.

    I personally maintain the version number of the nuget package in the .nuspec file and manually update it when I do a “release”. This way I can tag the exact release I pushed to the NuGet feed.

    With this setup a build in Visual Studio does not produce a NuGet package but all tools are available in the repository to do so.

    The Folder Structure looks like this:

       .\Docs\ ==> not in source repo
       .\Packages\ ==> not under source control
       .\Src\ ==> git repo here
       .\Src\MySolution.sln
       .\Src\.gitignore
       .\Src\MuRules.ruleset
       .\Src\build.proj ==> msbuild file to build everything.
       .\Src\MyProject\MyProject.csproj
       .\Src\MyProject\MyProject.nuspec
       .\Src\MyProject\nuget.config
       .\Build\ ==> not under source control
       .\Build\Debug\
       .\Build\Release\
       .\Build\Publish\
    

    Be aware of this bug in the Package Restore feature, it will ignore the packages location you configured. http://nuget.codeplex.com/workitem/1990 ==> This is fixed in Nuget 2.7

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

Sidebar

Related Questions

I have an open source project which is hosted on Github. I want to
I am using one open source project which is hosted on git-hub. I am
I'm contributing to a fairly small open source project hosted on Github. So that
I'm currently developing a small hobby project (open sourced at https://github.com/grav/mailbum ) which quite
I have two repositories: Gephi (big open source project) hosted on github Project of
I working on a cms project and using a open source cms that hosted
We use several open source libraries that are hosted on github. I want to
I have an application that depends on a 3rd party open source project hosted
I and my friend want to work on an open source project which is
I have a project hosted on GitHub and I use Git for source versioning.

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.