About NuGet
- Home page: http://www.nuget.org/
- Codeplex page: http://nuget.codeplex.com/
- Easy to read docs: http://docs.nuget.org/docs/start-here/overview
- Visual Studio extension (from nuget.org)
- Built-in to SharpDevelop
- Standalone manager (http://nuget.codeplex.com/)
Set Up NuGet (one-time setup on your computer)
- If you don't have an API key, get one from nuget.org by registering and then viewing your account info.
- Download NuGet and put somewhere convenient one your computer.
- Add NuGet.exe to your path.
- Set your API key (NuGet will remember it). You only need an API key if you're going to 'push' NuGet packages.
> NuGet SetApiKey <MyApiKey>
Set Up a NuGet Published Project
- Set the metadata on the project (in Properties\AssemblyInfo.cs, set AssemblyTitle, etc)
- Use NuGet to bring in dependencies using Add Library Package (see http://nuget.codeplex.com/documentation?title=Getting%20Started)
- Create the nuspec file (from the folder that contains the project file)
> NuGet YourPackage.nuspec
- Edit the nuspec file.
- The fields tokened like $id$, $version$, etc will be filled in later using values from your AssemblyInfo
- Remove fields you don't need, e.g. <iconUrl>
- At the least, the <projectUrl> and <licenseUrl> _should_ be filled in.
Publish the Project
- Ensure NuGet is up-to-date
> NuGet update
- Package the project (the command below is just an example...)
> NuGet pack -prop Configuration=Release MyProject.csproj
- Publish the package (either push using the command below or place the .nupkg file in the server's packages folder)
> NuGet push <packagepath> [-source http://mydomain.com/nuget] [MyApiKeyForThisSource]
Set Up a NuGet Server
- Option A: The traditional "easy" method... See "Creating Remote Feeds" here (requires IIS):
- Option B: The traditional "full-featured" method (requires IIS, Orchard gallery, others):
- Option C: A full-featured implementation without requiring Orchard (requires IIS):
- Option D: An implementation for Apache/MySQL/PHP servers: