Skip to content

Add RepositoryType to .csproj examples #16964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

leflings
Copy link

@leflings leflings commented Apr 9, 2022

Why:

I was banging my head against the wall for a long time getting this kind of response when pushing (using a nuget.config file)

$ dotnet nuget push "releases/<packages>.nupkg" --source "github" --api-key <PAT_TOKEN>
Pushing <package> to 'https://nuget.pkg.github.com/<owner>'...
  PUT https://nuget.pkg.github.com/<owner>/
warn : No destination repository detected. Ensure the source project has a 'RepositoryUrl' property defined. If you're using a nuspec file, ensure that it has a repository element with the required 'type' and 'url' attributes.
  BadRequest https://nuget.pkg.github.com/<owner>/ 102ms
error: Response status code does not indicate success: 400 (Bad Request).

Adding the <RepositoryType>git</RepositoryType> solved the problem.

What's being changed:

I've added missing nodes to the .csproj examples

Check off the following:

  • I have reviewed my changes in staging (look for "Automatically generated comment" and click Modified to view your latest changes).
  • For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • This pull request impacts the contribution experience
    • I have added the 'writer impact' label
    • I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

I was banging my head against the wall for a long time getting this kind of response when pushing (using a nuget.config file)

```
$ dotnet nuget push "releases/<packages>.nupkg" --source "github" --api-key <PAT_TOKEN>
Pushing <package> to 'https://nuget.pkg.github.com/<owner>'...
  PUT https://nuget.pkg.github.com/<owner>/
warn : No destination repository detected. Ensure the source project has a 'RepositoryUrl' property defined. If you're using a nuspec file, ensure that it has a repository element with the required 'type' and 'url' attributes.
  BadRequest https://nuget.pkg.github.com/<owner>/ 102ms
error: Response status code does not indicate success: 400 (Bad Request).
```

Adding the `<RepositoryType>git</RepositoryType>` solved the problem.
@welcome
Copy link

welcome bot commented Apr 9, 2022

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Apr 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 9, 2022

Automatically generated comment ℹ️

This comment is automatically generated and will be overwritten every time changes are committed to this branch.

The table contains an overview of files in the content directory that have been changed in this pull request. It's provided to make it easy to review your changes on the staging site. Please note that changes to the data directory will not show up in this table.


Content directory changes

You may find it useful to copy this table into the pull request summary. There you can edit it to share links to important articles or changes and to give a high-level overview of how the changes in your pull request support the overall goals of the pull request.

Source Preview Production What Changed
content/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.md Modified Original

@ramyaparimi ramyaparimi added content This issue or pull request belongs to the Docs Content team waiting for review Issue/PR is waiting for a writer's review packages This issue or pull request should be reviewed by the docs packages team and removed triage Do not begin working on this issue until triaged by the team labels Apr 11, 2022
@ramyaparimi
Copy link
Contributor

@leflings
Thanks so much for opening a PR! I'll get this triaged for review ⚡

@janiceilene
Copy link
Contributor

👋 @leflings Thanks for opening a PR and thank you for your patience as we're working through a backlog of reviews 💛 I spoke with the team, and they let me know that if you try to publish a NuGet package using a .csproj file, RepositoryType is not mandatory. However, if the person is using a .nuspec to publish packages, <RepositoryType>git</RepositoryType> is necessary.

Since there aren't changes needed in this doc, I'm going to close this PR now.

Thanks so much for your interest in improving the GitHub docs ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team packages This issue or pull request should be reviewed by the docs packages team waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants