Giter Site home page Giter Site logo

hello-nuget's Introduction

Overview

This project provides a minimal example for how to set up a .NET project for automatic packaging with NuGet.

Once you get the basics down, you will likely make some tweaks to streamline your workflow. Use these examples to help streamline and evolve your project to meet your needs:

  • HtmlTags.AspNet.Mvc - this project has a build script which takes advantage of some basic features of F# to manage the building and packaging of multiple projects, along with more nuanced configuration that you may find helpful.
  • Ocktokit - This project has good examples for integrating testing and multi-platform targeting

It is also a good idea to familiarize yourself with the tools used here, namely NuGet.exe, FAKE, and Git.

Feedback

Feedback on this solution is welcome. Tweet me @craigsmitham or create a GitHub issue.

Contents

  • Prerequisates
  • .NET Solution Conventions
  • Learning and Next Steps

Prerequisites

Git

Install Git for Windows. Install with the reccomended options, including using Git from the Windows Command Prompt. If you're not familiar with Git, I highly reccomend becoming proficient.

Visual Studio

This guide assumes you will be developing with Visual Studio.

.NET Solution Conventions

build.cmd

A simple batch file name 'build.cmd', located in the solution root, acts as a wrapper around the build system. As long as all prerequisites are installed, running this command should execute your build in one step. This script can also be used to simplify the execution of common build commands, such as compiling, testing, and package creation.

src/ Directory

All source files live in the ./src directory. There is a growing trend to put the Visual Studio solution (.sln) file in the repositories root directory. I like this, as it is a more natural fit with the build and solution level items, and the source code is not dependant on the solution file to run.

tools/ Directory

Any tools used as part of the build or needed for development can be placed in the tools directory. The tools can be placed here by a build script, or checked in to the repository.

tools/NuGet.exe

I usually check-in NuGet.exe to the tools directory, because it is small and rarely changes. The latest NuGet.exe can be downloaded from nuget.org at http://nuget.org/nuget.exe.

.gitignore

All projects using Git for source control should have a .gitignore file, which intstructs Git to ignore certain file types and directories within your project. .gitignore files are usually environment and platform specific, depending on your tools.

Build Tool

We will be using FAKE as a build tool to manage and automate tasks around compiling, testing, and packaging our project with NuGet. If you're not familiar with build tools, that's OK. There are other alternatives, including NAnt, PSake, and MSBuild. Visual Studio uses MSBuild directly, as do the other build tools, but these build tools allow for more flexible and accesible project configuration and setup in combination with MSBuild.

License

Always include a license and copyright notice with your project.

README

Your project should contain a readme to get new users up to speed.

Learning and Next Steps

  • Create your own project with a build script capable of automatic package creation

  • Publish your package to a NuGet feed, such as http://myget.org or http://nuget.org. Start with myget.org to get the hang of publishing packages, but use nuget.org once you have a package ready for distribution.

  • Integrate your project with an automated build CI, such as AppVeyor.com, publishing your new commits to a NuGet feed.

hello-nuget's People

Contributors

craigsmitham avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.