Skip to content

nuget.config breaks Nuget packages from private repositories #16946

@cdbrown2018

Description

@cdbrown2018

Is there an existing issue for this?

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions