in large and medium-sized projects there is always a dedicated staff to develop and maintain the underlying class library,encapsulating your own class library can not only improve the reusability of your code,reduce the amount of development,Make your code more concise,can also improve the speed of operation.but,The addition and modification of class library methods causes system developers who use the class library to frequently delete and add references.if the underlyingDLLToo many files,any change will result in a high error rate modification!!for ease of managementDLLfile,we useNuGetHow to update dynamically.
If you are a developer and maintainer of a class library , Please read the published article . If you are a class library-based developer , Please read the article on use .
Publish article:
( Suppose you have developed a class library at this point .)
1. Download the NuGet.exe and place it in the same directory as the . csproj file. This is a good tool for packing. , It can package our engineering documents .
: http://nuget.codeplex.com/downloads/get/669083
2. Register an account on the NuGet website and verify that you have an API Key. we'll call it My_api_key for the time being. .
Registered Address : https://www.nuget.org/
Then Set API Key.
suggested use to prevent errors start --vs2012--visual Studio tools--vs2012 developer Command Prompt .
Enter the following command settings NuGet API Key: nuget Setapikey <my_api_key>
3. Set the attribute version in your assemblyinfo. cs File , etc., and use it for the first time 1.0.0.0 It . Save settings and compile the entire project .
4.at the command prompt,Enter. csprojdirectory where the files are located,RunNuGetSpecCommand,will generate. Nuspecfile,like I built it here.Itoo. Library.EFBase.nuspec.
5.withNotepad++Open the file,Modify some of these values,It 's useless to erase it..$$between the can without tube,is automatically referencedAssemblyInfo.csthe setting value in.If you're not sure where to change where you need to delete,Let 's do it down.,pending Prompt Warning,can be modified again.
6. Also at the command prompt , Enter .csproj file directory , Enter the command to generate the class library package , Take my example , command as follows :
Nuget packITOO.Library.EFBase.csproj . Build after Success . Nupkg file , as I have generated here Itoo. Library.efbase.1.0.0.0.nupkg
7. finally publish the Class library package , enter the command :nuget push Itoo. Library.efbase. 1.0.0.0.nupkg
will prompt for publishing success .
Use the article:
1. Create a new project , right-select Manage NuGet Packages to search for the package name that has been successfully published above c10>, look at me .
Installation Complete , your project has been automatically added to the reference .
Development Articles(continued)
8. Class library needs to be modified , After the modification is done go to assemblyinfo .cs Modify the version number , Compile save after all modifications are completed
then generate the class library package and publish . that is also the command prompt , Enter . csproj The file directory , run two commands separately :
(1) To generate a class library package , Take my example. :
Nuget packITOO.Library.EFBase.csproj
(2) Publish a class library package , Take my example. :
NuGet Push Itoo. Library.efbase1.0.0. 1.nupkg
Use the article(continued)
2. Right-click on the project to select Manage NuGet Packagesand in the update you will see the class library package we are referencing , click Update .
so far , This little problem is solved. , as development continues to advance , The problem is sure to come back. , we do it and solve it. .
". NET" NuGet release class library package for easy management of DLL files