Skip to content

How do I publish a NuGet package for a legacy assembly? #54575

Closed Answered by GeoffreyFClark
Rod-at-DOH asked this question in Packages
Discussion options

You must be logged in to vote

PROJECT_NAME is your NuGet package name, usually the same as your project name. Running nuget.exe push won't overwrite your repo, it just uploads your package to the NuGet feed.

YOUR_GITHUB_PAT is the Personal Access Token itself, not its name. You use it to authenticate when you're pushing the package to GitHub.

You're right, you don't want to commit your PAT to your repo. Instead, put it in an environment variable and reference that in your NuGet.Config file. e.g.
< configuration >
  < packageSources >
    < add key="github" value="https://nuget.pkg.github.com/OWNER/index.json" />
  </ packageSources>

  < packageSourceCredentials>
    < github>
      < add key="Username" value="YOUR_GIT…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Rod-at-DOH
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Rod-at-DOH
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packages Host your dependencies, libraries, and production-ready code, right from your repository Question inactive This discussion has been automatically marked as inactive. This was formerly labeled stale.
2 participants