Skip to content
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

Mysterious new NuGet source (/usr/local/share/dotnet/library-packs) #28642

Closed
dannyyy opened this issue Oct 17, 2022 · 2 comments
Closed

Mysterious new NuGet source (/usr/local/share/dotnet/library-packs) #28642

dannyyy opened this issue Oct 17, 2022 · 2 comments
Labels
Area-NuGet untriaged Request triage from a team member

Comments

@dannyyy
Copy link

dannyyy commented Oct 17, 2022

Description

After following the installation guide for MAUI on MacOS I'm unable to restore any regular .NET solution. The installation of MAUI added somewhere hidden a new NuGet source /usr/local/share/dotnet/library-packs which takes precedence over all.

My setup is always the same. I have a NuGet.Config in my home folder /Users/<username>/.nuget/NuGet/ and a NuGet.Config in the root of my repository. They contain one source with the same name, targeting Azure DevOps Artifacts. This exists for years.

  • Executing dotnet nuget list source just lists the one source within my own NuGet.Config
  • The corresponding source panels in Visual Studio or Rider also just shows this one configured source

The resulting error is:

error NU1507: There are 2 package sources defined in your configuration. When using central package management, please map your package sources with package source mapping (https://aka.ms/nuget-package-source-mapping) or specify a single package source. The following sources are defined: https://xyz.pkgs.visualstudio.com/_packaging/MyProject/nuget/v3/index.json, /usr/local/share/dotnet/library-packs [/Users/<username>/Development/MyProject/MyProject.sln]

Where is this source configured? And how to get rid of them?

Steps to Reproduce

  1. Open any solution in any folder or create a new project with enabled central package management Directory.Packages.props
  2. Try to restore
  3. Be excited of the error above

Link to public reproduction project repository

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

macOS, I was not able test on other platforms

Affected platform versions

MacOS 12.6

Did you find any workaround?

Not yet

Relevant log output

`dotnet restore`
> error NU1507: There are 2 package sources defined in your configuration. When using central package management, please map your package sources with package source mapping (https://aka.ms/nuget-package-source-mapping) or specify a single package source. The following sources are defined: https://xyz.pkgs.visualstudio.com/_packaging/MyProject/nuget/v3/index.json, /usr/local/share/dotnet/library-packs [/Users/<username>/Development/MyProject/MyProject.sln]

---

`dotnet worload list`
> Installed Workload Ids      Manifest Version      Installation Source
---------------------------------------------------------------------
wasm-tools                  6.0.10/6.0.400        SDK 6.0.400        
macos                       12.3.465/6.0.400      SDK 6.0.400        
ios                         16.0.517/6.0.400      SDK 6.0.400        
maccatalyst                 15.4.465/6.0.400      SDK 6.0.400        
maui                        6.0.541/6.0.400       SDK 6.0.400        
tvos                        16.0.517/6.0.400      SDK 6.0.400        
android                     32.0.476/6.0.400      SDK 6.0.400  

---

`dotnet nuget list source`
> Registered Sources:
  1.  XYZ [Enabled]
      https://xyz.pkgs.visualstudio.com/_packaging/MyProject/nuget/v3/index.json
@PureWeen PureWeen transferred this issue from dotnet/maui Oct 18, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NuGet untriaged Request triage from a team member labels Oct 18, 2022
@ghost
Copy link

ghost commented Oct 18, 2022

Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the NuGet repository instead. Don’t forget to check out NuGet’s contributing guide before submitting an issue!

If you believe this issue was closed out of error, please comment to let us know.

Happy Coding!

@ghost ghost closed this as completed Oct 18, 2022
@KalleOlaviNiemitalo
Copy link
Contributor

KalleOlaviNiemitalo commented Oct 19, 2022

This seems pretty much a duplicate of #27840, which suggests the undocumented DisableImplicitLibraryPacksFolder property as a workaround. The property is checked here:

<PropertyGroup Condition=" '$(DisableImplicitLibraryPacksFolder)' != 'true' ">
<RestoreAdditionalProjectSources Condition="Exists('$(_WorkloadLibraryPacksFolder)')">$(RestoreAdditionalProjectSources);$(_WorkloadLibraryPacksFolder)</RestoreAdditionalProjectSources>
</PropertyGroup>

That code was added in #12314 for #11493. At the NuGet side, the problem should have been fixed in NuGet/NuGet.Client#4764 for NuGet/Home#11951, but that fix is not on the release-6.3.x branch, so you may have to wait for the NuGet 6.4 release.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NuGet untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants