DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Build, Publish and Deploy NuGet Package Using Github Actions
  • Install NuGet Packages in Visual Studio

Trending

  • OneStream Fast Data Extracts APIs
  • How To Use ChatGPT API in Python for Your Real-Time Data
  • What Is Kubernetes RBAC and Why Do You Need It?
  • Securing Your Applications With Spring Security

How to Set Up a Local NuGet Gallery

Michael Ceranski user avatar by
Michael Ceranski
·
Feb. 06, 12 · News
Like (0)
Save
Tweet
Share
19.44K Views

Join the DZone community and get the full member experience.

Join For Free

First of all you may be wondering, why do I want my own local Nuget Gallery? Well, here are two reasons:

  • Having your own NuGet server is perfect for when you need share modules with other people on your team but you do not necessarily want to make them available for public consumption.
  • If you are a consultant then having your own personal NuGet Gallery may be a handy way to keep your libraries and utilities accessible to you when you are on the road. This is an great way to utilize your home broadband connection.

Last year I wrote an article about how to Build a NuGet Server with gold plating. At the time, there were two methods for hosting your own NuGet feed. The first option was to install the Orchard-based NuGet Gallery. I personally stayed away from this option because setting up an entire CMS just to host a few small NuGet packages seemed like overkill to me. The second option was to create an empty ASP.NET MVC site and install a few NuGet packages from Phil Haack that turned your empty website into a NuGet server. I call the second option the recursive NuGet server because you install NuGet packages which in turn help you to create a NuGet server. Anyway, if you compare the features of the Orchard Nuget Gallery to the recursive NuGet server, you will instantly notice that the Orchard version had a lot more functionality. Unfortunately, at the time I still could not justify setting up an entire CMS just to get a few small features.

Eventually someone on the NuGet team realized that having the gallery so tightly coupled with Orchard was probably not a good idea. So sometime late last year, the NuGet gallery was removed from Orchard which made the setup process a lot less complex. Unfortunately the documentation page for Setting Up a Local NuGet Gallery has not been updated yet and still reflects the steps for creating the Orchard-based gallery. Since I recently setup a NuGet server at the office I decided to document the new steps in order to save you some trouble.

  1. Download the latest source from GitHub. I just grabbed the zip file since I do not have a Git client on my machine.
  2. Extract the zip file and navigate to the Website subdirectory. Locate the web.config file and open it up in your favorite editor. Inside the web.config you will want to change the following options:
    1. Modify the configuration/connectionStrings/NuGetGallery key so it points to your locally hosted SQL Server.
    2. Change the appSettings/GalleryOwnerEmail to the email address of the person who is going to administer the site.
    3. Change the appSettings/Configuration:SiteRoot to reflect the domain name you are going to use for the site.
  3. Run the Build-Solution.ps1 script using Powershell in the root directory. This will compile the website and assemble the binaries.
  4. Open up your IIS Manager
    1. Create a new application pool. The pool should use the 4.0 framework and use an integrated pipeline. Please pay careful attention to the Identity of the pool because you will need to grant this account permissions to your SQL Server.
    2. Create a new website. Set the site’s physical path to point at the Website directory. Also make sure the site uses the application pool that you created in the previous step. Do not start the website yet.
  5. Open up SQL Server Management Studio
    1. Grant db_creator to the identity of the application pool you created earlier. The account needs db_creator because the first time you run the applicaton, the Entity Framework context initializer will run. If no database exists yet then it will create the database for you. After, the database is created you can trim back the permissions to db_datareader and db_datawriter. This tends to make your DBA happy.
  6. Start your website and launch the browser of your choice. In the browser, navigate to the NuGet server. It may take a second or two for the page to appear because the database needs to get created during the first run.

If you followed the steps properly then you should see the following page:

image

NuGet

Published at DZone with permission of Michael Ceranski, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Build, Publish and Deploy NuGet Package Using Github Actions
  • Install NuGet Packages in Visual Studio

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: