Secret ingredients to quality software

  • Services
    • Products
      • Training
        • User Group
          • Rules
            • About Us
              • SSW TV
              SSW Foursquare

              Rules to Better Nuget - 4 Rules

              Since 1990, SSW has supported the developer community by publishing all our best practices and rules for everyone to see.

              If you still need help, go to SSW Consulting Services and book in a consultant.

              1. Do not avoid checking in nuget or npm packages into source control?

                Reasons for avoiding checking Nuget or Npm packages

                1. Distributed version control systems, such as Git, include full copies of every version of every file within the repository. Binary files that are frequently updated lead to significant bloat and lengthens the time it takes to clone the repository.
                2. When packages are included in the repository, developers are liable to add references directly to package contents on disk rather than referencing packages through NuGet, which can lead to hard-coded path names in the project.

                nugetpackages

                Figure: Do not have a folder called "packages" or "Node_Modules"

                Read more about how to omit NuGet packages in source control system

                For better package management , may consider using the Package Management tool in TFS

              2. Do you create a private repository for reusable internal code?

                Nuget is great for managing publicly available packages, but it’s also surprisingly easy to create and publish your own packages to your own nuget server for internal code reuse across multiple solutions.

                private nuget 1
                Figure: You can create your own nuget server by simply creating a new asp.net web project and adding the Nuget.Server package

                private nuget 2
                Figure: Add your new server as a package source under Tools | Options | Nuget Package Manager | Package Sources

              3. Do you know the best NuGet Packages ?

                The best NuGet packages are:

              4. Do you update your packages regularly?

                Nuget makes it easy to find and apply package updates – but this still must be performed manually.

                Each package update should contain improvements but also involves a small amount of risk in the form of breaking changes or regressions.

                Updating often can help mitigate this risk by ensuring that each individual update is smaller.

                Recommended practice is to apply package updates at the start of a Sprint so that there is time to find and resolve issues introduced by the update.

                update nuget
                Figure: Nuget package updates

              We open source. Powered by GitHub