.NET_Framework

.NET Core.NET Framework Acronym Glossary.NET Framework ADO.NET.NET Framework CLR.NET Framework Code Contracts.NET Framework Collections.NET Framework Custom Types.NET Framework DateTime parsing.NET Framework Dependency Injection.NET Framework Dictionaries.NET Framework Encryption / Cryptography.NET Framework Exceptions.NET Framework Expression Trees.NET Framework File Input/Output.NET Framework ForEach.NET Framework Garbage Collection.NET Framework Globalization in ASP.NET MVC using Smart internationalization for ASP.NET.NET Framework HTTP clients.NET Framework HTTP servers.NET Framework Introduction.NET Framework JIT compiler.NET Framework JSON Serialization.NET Framework LINQ.NET Framework Managed Extensibility.NET Framework Memory management.NET Framework Networking.NET Framework NuGet packaging system.NET Framework Platform Invoke.NET Framework Process and Thread affinity setting.NET Framework Reading and writing Zip files.NET Framework ReadOnlyCollections.NET Framework Reflection.NET Framework Regular Expressions (System.Text.RegularExpressions).NET Framework Serial Ports.NET Framework Settings.NET Framework SpeechRecognitionEngine class to recognize speech.NET Framework Stack and Heap.NET Framework Strings.NET Framework Synchronization Contexts.NET Framework System.Diagnostics.NET Framework System.IO.NET Framework System.IO.File class.NET Framework System.Net.Mail.NET Framework System.Reflection.Emit namespace.NET Framework System.Runtime.Caching.MemoryCache (ObjectCache).NET Framework Task Parallel Library (TPL).NET Framework Task Parallel Library (TPL) API Overviews.NET Framework Threading.NET Framework TPL Dataflow.NET Framework Unit testing.NET Framework Upload file and POST data to webserver.NET Framework Using ProgressT and IProgressT.NET Framework VB Forms.NET Framework Work with SHA1 in C Sharp.NET Framework Write to and read from StdErr stream.NET Framework XmlSerializerJSON in .NET with Newtonsoft.JsonParallel processing using .NET framework



.NET Framework NuGet packaging system

From WikiOD

Remarks[edit | edit source]

NuGet.org:

NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.

Images in examples courtesy of NuGet.org.

Installing a specific version of a package[edit | edit source]

PM> Install-Package EntityFramework -Version 6.1.2

Uninstalling a package from one project in a solution[edit | edit source]

PM> Uninstall-Package -ProjectName MyProjectB EntityFramework

Adding a package source feed (MyGet, Klondike, ect)[edit | edit source]

nuget sources add -name feedname -source http://sourcefeedurl

Installing the NuGet Package Manager[edit | edit source]

In order to be able to manage your projects' packages, you need the NuGet Package Manager. This is a Visual Studio Extension, explained in the official docs: Installing and Updating NuGet Client.

Starting with Visual Studio 2012, NuGet is included in every edition, and can be used from: Tools -> NuGet Package Manager -> Package Manager Console.

You do so through the Tools menu of Visual Studio, clicking Extensions and Updates:

NuGet_packaging_system

This installs both the GUI:

  • Available through clicking "Manage NuGet Packages..." on a project or its References folder

And the Package Manager Console:

  • Tools -> NuGet Package Manager -> Package Manager Console.

Managing Packages through the console[edit | edit source]

Click the menus Tools -> NuGet Package Manager -> Package Manager Console to show the console in your IDE. Official documentation here.

Here you can issue, amongst others, install-package commands which installs the entered package into the currently selected "Default project":

Install*Package Elmah

You can also provide the project to install the package to, overriding the selected project in the "Default project" dropdown:

Install*Package Elmah -ProjectName MyFirstWebsite

Updating a package[edit | edit source]

To update a package use the following command:

PM> Update-Package EntityFramework

where EntityFramework is the name of the package to be updated. Note that update will run for all projects, and so is different from Install-Package EntityFramework which would install to "Default project" only.

You can also specify a single project explicitly:

PM> Update-Package EntityFramework -ProjectName MyFirstWebsite

Uninstalling a package[edit | edit source]

PM> Uninstall-Package EntityFramework

Managing Packages through the UI[edit | edit source]

When you right-click a project (or its References folder), you can click the "Manage NuGet Packages..." option. This shows the Package Manager Dialog.

NuGet_packaging_system

uninstall a specific version of package[edit | edit source]

PM> uninstall-Package EntityFramework -Version 6.1.2

Using different (local) Nuget package sources using UI[edit | edit source]

It is common for company to set up it's own nuget server for distribution of packages across different teams.

  1. Go to Solution Explorer and click Right Mouse button then choose Manage NuGet Packages for Solution

NuGet_packaging_system

  • In window that opens click on Settings

NuGet_packaging_system

  • Click on + in top right corner then add name and url that points to your local nuget server.

NuGet_packaging_system

Credit:Stack_Overflow_Documentation