Set up Nuget private server on Windows server

I declare: This article is my original, originally published on CSDN: blog.csdn.net/m0_37752065…

I. Create a blank solution using VS2017/VS2019, as shown in the figure below:

Step 1: Take VS2019 as an example. Open VS2019 and select “Create a New project”.

Step 2: Select “Blank Solution” and click “Next”;

Step 3: Fill in the solution name and select a location for storing the solution to facilitate the demonstration.

Step 4: Complete phase 1 at this point.

2. Select the solution name and create an empty project, as shown in the figure below.

Step 1: ① Right-click the solution name and choose ② [Add] — ③ [New Project] from the pop-up menu.

Step 2: ① Select the “ASP.NET Web Application (.net Framework)” option (you can search quickly by using the upper search box), ② then click the “Next” button.

Step 3: ① Fill in the project name (it is recommended to have the same name as the solution), ② storage location, ③ framework, and ④ Click the “Create” button

Step 4: ① Select the empty template, ② deselect HTTPS configuration, and ③ click the “Create” button.

Step 5: At the end of phase 2, create an empty ASP.NET Web Application (.NET Framework) project successfully.

Iii. Install Nuget.Server package for the project and publish it, as shown in the figure below:

Step 1: ① Select tools in the navigation bar at the top of VS2019, ② select Nuget Package Manager — Package Manager Console from the menu bar.

Step 2: (1) Default Item Select the current item and keep the default. ② Enter the following code: After input, press the “Enter” key; The system automatically deploys the Nuget service package.

PM>Install - Package NuGet. Server - Version 3.4.1 track
Copy the code

Step 3: Double-click the web. config file under the project to open it.

Step 4: ① Delete the code in the red box and Ctrl+S to save it. Note: This step can not be ignored, or later deployment to the IIS server will cause an error!

Step 5: ① Right-click the project name, ② choose “Publish (B)…” from the pop-up menu. Options.

Step 6: ① In the pop-up window, select “Folder” item, ② then click “Next”.

Step 7: Select a publishing location. 1) click the text box on the right side of the “browse” button, (2) click on the desktop (demonstrated here for the convenience of find a folder, so chose the desktop, can according to their own need to choose any location), (3) click on the “new folder”, (4) enter a folder name (fill in name but oneself, here the default fill PJ_SOURCE), (5) click on the [sure] button, Finally, click the “Finish” button.

Step 8: On the release interface, ① click the “Publish” button to publish.

Step 9: Specific operation visible text.

Step 10: Copy all files to Windows server.

Iv. Create a Nuget server website, as shown in the following figure:

Step 1: Open the IIS server, right-click ① [website] — ② [Add website]

Step 2: ① Enter the website name. By default, enter MyNugetServer and select DefaultAppPool for the application pool. ② Click on the right of the text box […] Button. ③ Select the newly created folder to store the published files. ④ Then click the “OK” button. ⑤IP Address Click the drop-down symbol to select an existing IP address. ⑥ Click the “OK” button.

Step 3: ① After the site is added, the newly created MyNuGetServer website will appear in the website tree list. ② Click on the right to browse your IP address :80(HTTP). If the following page appears, you have successfully deployed your own private NuGet server.