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

dotnet restore fails due to disabled machine wide feed #5410

Closed
danroth27 opened this issue Jun 14, 2017 · 4 comments
Closed

dotnet restore fails due to disabled machine wide feed #5410

danroth27 opened this issue Jun 14, 2017 · 4 comments
Labels
Area:Settings NuGet.Config and related issues Priority:2 Issues for the current backlog. Type:Bug
Milestone

Comments

@danroth27
Copy link

Repro steps:

C:\Users\daroth\Desktop\test>dotnet restore
  Restoring packages for C:\Users\daroth\Desktop\test\test.csproj...
C:\Program Files\dotnet\sdk\2.0.0-preview2-006391\NuGet.targets(102,5): error : Failed to retrieve information about 'System.Diagnostics.DiagnosticSource' from remote source 'C:\Program Files\Microsoft SDKs\Service Fabric\packages\'. [C:\Users\daroth\Desktop\test\test.csproj]

The problematic machine wide feed was originally setup when I installed the service fabric SDK, which I have since removed. The configuration of the service fabric machine wide feed was left behind at C:\Program Files (x86)\NuGet\Config\ServiceFabricSDK.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
      <add key="Microsoft Azure Service Fabric SDK" value="C:\Program Files\Microsoft SDKs\Service Fabric\packages\"/>
    </packageSources>
</configuration>

The specified folder for the service fabric packages no longer exists, as indicated by the restore error. However, the service fabric feed is disabled in my nuget.config file at C:\Users\daroth\AppData\Roaming\NuGet\NuGet.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Local feed" value="c:\feed" />
    <add key="danroth27" value="https://www.myget.org/F/danroth27/api/v3/index.json" />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
    <add key="aspnetcore-release" value="https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json" />
    <add key="CliFallbackFolder" value="C:\Users\daroth\.dotnet\NuGetFallbackFolder" />
    <add key="msbuild" value="https://dotnet.myget.org/f/msbuild/api/v3/index.json" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
  <disabledPackageSources>
    <add key="danroth27" value="true" />
    <add key="dotnet-core" value="true" />
    <add key="aspnetcore-release" value="true" />
    <add key="aspnetcore-final" value="true" />
    <add key="msbuild" value="true" />
    <add key="Microsoft Azure Service Fabric SDK" value="true" />
  </disabledPackageSources>
</configuration>

So I don't think it should be used at all for restore.

C:\Users\daroth\Desktop\test>dotnet --info
.NET Command Line Tools (2.0.0-preview2-006391)

Product Information:
 Version:            2.0.0-preview2-006391
 Commit SHA-1 hash:  ef5d4b47c3

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0-preview2-006391\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-25407-01
  Build    : 40c565230930ead58a50719c0ec799df77bddee9
@danroth27
Copy link
Author

Remove C:\Program Files (x86)\NuGet\Config\ServiceFabricSDK.config does resolve the error.

@emgarten emgarten added the Area:Settings NuGet.Config and related issues label Jun 15, 2017
@emgarten emgarten added this to the Future-0 milestone Jun 15, 2017
@emgarten
Copy link
Member

Disabling the source in your user wide config should have removed it, there may be an issue here with how the config files are being prioritized.

@mishra14 mishra14 modified the milestones: Future-0, Backlog Nov 30, 2017
@mishra14 mishra14 added Triage:Investigate Priority:2 Issues for the current backlog. labels Nov 30, 2017
@PatoBeltran PatoBeltran modified the milestones: Backlog, 5.0 Oct 22, 2018
@PatoBeltran
Copy link

This has been solved as part of the latest rework on the nuget.configuration code paths.

@rrelyea
Copy link
Contributor

rrelyea commented Jan 25, 2019

This fix may have shipped as part of 4.9. Closing this for sure now in the 5.0.0-preview2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Settings NuGet.Config and related issues Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

5 participants