Transferred from: http://developer.51cto.com/art/201201/311365.htm
You can find the corresponding library initialization path in the online http://www.nuget.org/packages directory first by the output Directory Management library in the Console Package Manager console similar to found Json.NET/HTTP// The Www.nuget.org/packages/Newtonsoft.Json initialization path is: We are able to operate now based on the online NuGet official data source package operation. Of course we can set the package data source to cost Find the green button package Manager Settings:
AD:
The NuGet tool was first started on the MIX11. I don't know if I saw a little detail in the mix.-That's all the MS developers in the MIX11 Code demo session use NuGet. This article describes some of the NuGet installations and some basic usage in actual projects.
First explain what the NuGet tool is.
NuGet is a Visual Studio extension tool that simplifies the addition, updating, and deletion of libraries (deployed as packages) in Visual Studio projects. The NuGet package is a set of files packaged into one file, with the extension. NUPKG, using the Open Packaging Convention (OPC) format.
Before you use the NuGet tool. If we want to add a reference to a library in a normal. NET project. The simplest way is to add a DLL reference to implement a third-party code library Reference. Unzip by downloading. Add a reference operation if you need to do a lot of manual grooming for project dependencies at the time of publishing. The whole process of cloth has a management "vacuum" state. If you want to share our code with other developers or organizations. Whether it means more complex operations. That's exactly what NuGet did.
There are two ways to install NuGet. Mode one opens Visual Studio 2010 and opens the Tool->extension Manager form. Select the online Gallery and enter NuGet in the search box to see:
Click Download Download will be installed automatically, another way to open http://www.nuget.org/directly download the installation files NuGet Manager. Click Run to start the installation:
Select the Installation tool Next:
Installation is complete. If an error occurs during the installation process, the installation will prompt you in the install screen:
Determine the cause of the error after installing an error by viewing the install Log:
If you feel trouble, you may not look. Directories that are found directly remove the NuGet Package Manager folder and reinstall the NuGet tool. After the installation is complete, you can create a Windows Phone application open tool-> Library Package Manager->package Manager Console:
You can find the corresponding library initialization path in the online http://www.nuget.org/packages directory first by the output Directory Management library in the Console Package Manager console similar to found Json.NET/HTTP// The Www.nuget.org/packages/Newtonsoft.Json initialization path is:
Input: Install-package Newtonsoft.json
If the corresponding library file is large. The download progress is prompted in the lower-right corner of visual Studio. After the installation is complete:
You can see in the current project directory that you have successfully added to the reference:
You can add library files manually by referencing administration. In the references reference to the solution you can see:
One more manage Nuget packages open the Admin form to enable the installation of the library file management:
NuGet provides Windows PowerShell-based console windows (called the Package Manager console) and a set of Windows PowerShell commands to interact with NuGet. Windows PowerShell is a. NET-based scripting language and a command-line shell that makes it ideal for composing command sets and working with objects. Of course PowerShell provides powerful support for the Package Manager console to directly manage the Unload library For example, uninstall already referenced json.net library input: unstall-package Newtonsoft.json Uninstall. If you want to see the package that the current project already references, get the get-package directly from the console via the instruction:
See that the library file and the version other information are already in use in the current project. If there are new versions of the referenced components, you can still batch update the libraries already referenced through Update-package:
The command attempts to update each package to the latest version, which can be a very significant operation if any package contains significant changes. In most cases, you only want to update the packages to the latest patch version. This is called a "security" update, provided that a package with a large build number or revision number (but with the same major and minor version numbers) can be backwards compatible. Add safe tags only to perform security updates: Example: Update-package–safe
Of course we can do this now based on the online NuGet official data source package operation. Of course we can set the cost of the package data source to find the green button of the Settings:
Open and add a local package data source under a specified local directory:
You can see the specified data source settings in the console by setting the classification localpackages:
Of course for companies and development teams with larger organizations. If you simply use SVN and git management, it's still not easy to control different library versions and externally shared controls. NuGet provides enterprise users with the ability to build a NuGet server within the enterprise to manage internal development team Library sharing in a unified manner . Greatly improve the development efficiency.
Installation of NuGet tools and basic usage of actual projects