Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Can't connect to GitHub Package Registry from Visual Studio

$
0
0

In Visual Studio 2019, I'm trying to connect to our private GitHub Package Registry but keep getting unauhorized error.

Here's what I've done:

  1. Created a Personal Access Token (PAT) on GitHub with Write access to packages.
  2. I then created a nuget.config file with following code and placed it in c:\Users\My_User_Name\AppData\Roaming\NuGet\ folder.
  3. I also tried placing this nuget.config file in the project root

I still get unauthorized error when I try to connect to our GitHub Package Registry. Any idea what the problem is?

Here's the nuget.config file contents:

<?xml version="1.0" encoding="utf-8"?><configuration><packageSources><clear /><add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /><add key="Our Corporate GitHub Packages" value="https://nuget.pkg.github.com/OUR_CORPORATE_ACCOUNT_ON_GITHUB/index.json" /><add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" /></packageSources><packageSourceCredentials><github><add key="Username" value="MY_GITHUB_USERNAME" /><add key="ClearTextPassword" value="MY_GITHUB_PERSONAL_ACCESS_TOKEN" /></github></packageSourceCredentials></configuration>

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>