Skip to content

Commit 1ad7098

Browse files
authored
Add C# Troubleshooting - Nuget Packages Auth
1 parent e0bb3f5 commit 1ad7098

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

troubleshooting/codeql-builds/compiled-languages-csharp.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ Using `dotnet` is best documented at: https://docs.github.com/en/actions/automat
5555
#### NuGet Error NU1301
5656
This can indicate your custom package server is not configured which may fail the `dotnet restore` command. For private package servers, the follwing guidance shows how to add package sources: [Setting up authentication for nuget feeds](https://github.com/actions/setup-dotnet#setting-up-authentication-for-nuget-feeds)
5757

58+
#### NuGet.targets(132,5): warning : Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
59+
60+
Consider adding auth for your GitHub Packages hosted NuGet feed using the nuget CLI tooling. Add this before the `autobuild` / custom build steps in your workflow.
61+
62+
```yml
63+
- name: add nuget auth
64+
run: dotnet nuget add source https://nuget.pkg.github.com/<org-goes-here>/index.json -n "GitHub" -u USERNAME -p "${{ secrets.GH_PACKAGES_READ_ONLY }}" --store-password-in-clear-text
65+
```
66+
67+
5868
### .NET Framework
5969
6070
#### NuGet Authentication

0 commit comments

Comments
 (0)