NuGet
30-Oct-1313 Leave a comment
This is well documented elsewhere. The purpose of this post is to collate links and pull out for my own notes those features and commands that I most use, and may not recall.
NuGet Package Manager Console
Finding and Installing a NuGet Package Using the Package Manager Console and removing and updating a package
http://docs.nuget.org/docs/start-here/Using-the-Package-Manager-Console
Key commands:
- get-help Install-Package
- Install-Package EntityFramework
- Unistall-Package EntityFramework
- Get-Package EntityFramework -updates to see if there are newer versions available
- Update-Pacakge EntityFramework
NuGet Package Explorer – Including Create Package
I have always had work to do to copy my own assemblies into common locations. NuGet offers the possibility of hosting your own NuGet feeds, which may be local. If I understand this correctly, this looks very interesting and might solve my issue and save me some time.
http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#api-key
http://docs.nuget.org/docs/Creating-Packages/Hosting-Your-Own-NuGet-Feeds
This requires the NuGet Package Explorer: http://npe.codeplex.com/
I found this would not install because I did not have .NET Framework 4.5 installed, as I am only on Visual Studio 2010. I installed 4.5 as my belief was that this would not break VS 2010. Creating the package then became easy with a few notes:
Use Tools > Analyze package to see if there are any issues.
It does like to have the target .Net Framework:
lib > net40 > myAssembly.dll
Creating your own package – Dependencies on your own packages
- Edit Metadata
- Edit dependencies
- Groups + Gave me [no target framework]
- Properties
- Package Source *** Put in here the location of your LocalNuGetFeed *** Reload
- Select your required package
- open
Creating your own online NuGet package feed
TODO
http://haacked.com/archive/2011/03/31/hosting-simple-nuget-package-feed.aspx/
My favourite Nuget packages
- Entity Framework
- Data connection – for connection dialog box for my tool kit software
End