Benpian experience will step NuGet server and introduce network build, we want to work and study help!
NuGet Website Builder
-
Create an empty ASNET website, as shown below:
Note: The Framework is set to 4.6 or more, NuGet.Server library requires .net framework version is 4.6.
-
With NuGet installation "NuGet.Server" library NuGetServer.
After successful installation, your Solution will become such a structure. And you do not need to write any code or change any configuration, it has been run. Run this site, if you see the following welcome screen, then the site has been constructed completed, as shown below:
Note: Packages only one readme.txt, this directory is used to put NuGet package, click here connected, you can view the existing package.
-
The deployment site, and deploy it exactly like any ASP.NET website, here not elaborate.
END
Code is packaged as packets NuGet
-
Go Nuget official website to download nuget command line tool, download address: www.nuget.org/downloads.
-
Packaged with Nuget
There are two ways Nuget package, the first one is directly through the pack dll project file:
Create a class library, and then compile under. The file you just downloaded nuget.exe copied to the project file in the same folder, as shown below:
-
Nuget line to create the command packet: nuget.exe pack, as shown below:
-
The second method is to use nuget the spec file is packaged.
Also to be packaged DLL with NuGet.exe placed under a directory, create a file with nuspec nuget spec command, as shown below:
-
Package.nuspec open the file, you can customize some configuration.
Note: $ description $ AssemblyDescriptionAttribute use of replacement value, before generating the package, be sure to remember to compile the project, otherwise it will prompt error $ description $ found.
-
Nuget baling NuGet pack into packets, as shown below:
-
So far package is completed.
-
The NuGet package uploaded to the server
The packaged .nupkg files are copied to the first step in a good frame Nuget under Package directory server. Nuget service can write a file upload capabilities to reduce cumbersome copy.
END
Configuring Visual Studio
-
Nuget service has been set up successfully, the next step is to configure NuGet source VS, let other projects can use our NuGet server.
Select the Tools -> Nuget Package Manager -> package management console, click on the icon configuration, as shown below:
Add, set the local NuGet source name and address. Note: source finally / nuget
Upon completion, we can install the VS NuGet package from the PW.
-
Use in other projects
So far NuGet server has been configured, packaged class libraries and DLL files are also introductions, then how do we reference NuGet intranet server package in the project do the following steps:
NuGetTest a new project, and Tools -> Nuget Package Manager -> package management console, the command line: install-package IKSDK, as shown below:
-
Finally, to see the effect, as shown below:
So far, the network set up NuGet server process is introduced over.
-