Setting up the Server
- Download the source code from GitHub.
[Note: You can download everything in a zip file] - Extract the zip file to a folder.
- Open the solution in Visual Studio 2012.
- Add an App_Data folder to the Website project.
- Build the Solution.
[Note: All the dependent NuGet packages will be downloaded and installed] - Change the NuGetGallery connection string in the Website project's web.config file to your SQL Server.
[Note: I used a SQL Server, LocalDB not working for me] - Go to Tools->Library Package Manager->Package Manager Console.
[Note: You need NuGet installed to get this] - Enter and execute the command: update-package EntityFramework
- Shutdown and restart Visual Studio 2012.
[Note: You must do this!] - Re-open the solution.
- At the Package Manager Console, enter and execute the command: update-database
[Note: This creates the database]
If everything is done correctly, you should be able to browse to your local NuGet website now. You can then publish it to an IIS server. To ensure that your NuGet Website can run in IIS, you will need to grant the IIS_IUSRS account modify access to the App_Data folder.
Setting up the Feed
Once your NuGet Gallery is up and running on IIS, you can then provide a NuGet feed to your developers. Instruct your developer to perform the following on their Visual Studio 2012.
- Go to Tools->Library Package Manager->Package Manager Settings[Note: Only appears when there is an opened Project]
- The Options dialog opens.
- Expand the Package Manager->Package Sources tree.
- Add a new package source.
- Specify the Source as http://[put-your-server-name-here]/nuget/api/v2
- Click Update.
- Click OK to close the Options dialog.
The developers should be able to get your NuGet packages from their Visual Studio now.
No comments:
Post a Comment