nuget.config breaks Nuget packages from private repositories
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
The nuget.config file that's generated by the Aspire CLI breaks building in CI environments. I have packages hosted in a private GitLab package repository, and when running `dotnet build` or `dotnet restore` in a CI environment, it fails with the following error:
```
/redacted/path/to/my/CsProj.csproj: error NU1101: Unable to find package REDACTED. No packages exist with this id in source(s): https://api.nuget.org/v3/index.json. PackageSourceMapping is enabled, the following source(s) were not considered: DEPOT. [/redacted/path/to/my/APIsln]
```
### Expected Behavior
I believe the point of nuget.config is to allow nuget to know where to pull packages from, whether that's a local hive, pre-release repositories, or public stable repositories(?). This should not disable the discovery of packages from private repositories.
### Steps To Reproduce
1. Reference a package from a private repository. (My reference is in a C# project that's registered with the AppHost, though I believe the same effect can be achieved by referencing the package in the AppHost's project)
2. Create a nuget.config using the Aspire CLI (I believe this is done by installing a local hive or by changing the channel from `stable` to `daily`)
3. Attempt to build the project in a CI environment.
### Exceptions (if any)
_No response_
### Aspire doctor output
_No response_
### Anything else?
_No response_
Contributor guide
Research direction
Start by tracing the nuget.config generated by the Aspire CLI, then reproduce the failure with dotnet restore or dotnet build against a project referencing a private GitLab package repository. Compare the generated package source and PackageSourceMapping behavior with the expected private source handling. Done means the generated configuration no longer prevents private packages from being discovered in CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100