Skip to content

dotnet restore does not consider RestoreAdditionalProjectSources coming from a NuGet package #49292

@DarkDaskin

Description

@DarkDaskin

Describe the bug

I have some projects which consume packages from a private feed. To avoid specifying RestoreAdditionalProjectSources in every project, I made a NuGet package containing that property in its *.Build.props. Specifying this package in a PackageReference alongside the private ones works in Visual Studio, but not in CLI.

To Reproduce

  1. Create an empty project with following contents:
    https://gist.github.com/DarkDaskin/fd9512e1edbbb9fe912d68057d3870e2#file-myproject-csproj
  2. Create a NuGet package with the following file in the build directory and specify its location in NuGet source settings:
    https://gist.github.com/DarkDaskin/fd9512e1edbbb9fe912d68057d3870e2#file-unitymodstudio-bepinex-build-props
  3. Open MyProject.csproj on Visual Studio and select Restore NuGet Packages in the Solution Explorer. It works.
  4. Run dotnet restore in the directory containing MyProject.csproj. It fails.

Exceptions (if any)

error NU1101 regarding BepInEx.* packages. Their private feed is not listed there.

Further technical details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions