dotnet restore --configFile <file> does not restore custom MsBuild SDKs #8183
Labels
Product:MSBuildSDKResolver
The NuGet powered SDK resolver. Owned by MSBuild team
Resolution:Duplicate
This issue appears to be a Duplicate of another issue
When using
dotnet restore --configFile <NuGet config file>
, and if you are using a custom MsBuild SDK in a csproj, dotnet restore will fail to retrieve the SDK.This error does not happen if you just run
dotnet restore
.This happens with all the ways the SDK can be referenced in the project.
Here is an example of how a custom SDK can be referenced:
NuGet.config file I'm using, but this error also occurs when
<packageSourceCredentials>
are included.Details about Problem
NuGet product used: dotnet.exe
NuGet version: N/A
dotnet.exe --version: 2.2.204 & 2.2.300
OS version:
Worked before? If so, with which NuGet version: N/A
Detailed repro steps so we can see the same problem
Install https://github.com/Microsoft/artifacts-credprovider
Create a .NET-Core MsBuild SDK NuGet project and upload it to a NuGet feed.
Create a .NET-Core project which consumes the SDK project created in step 1. Make sure to include a nuget.config file which references the feed the SDK package is hosted from.
Run
dotnet restore
and notice no issue. (You may have to rundotnet restore --interactive
the first time).Delete the custom SDK from your NuGet cache (
C:\Users\<USER>\.nuget\packages\<SDK package>
)Delete contents of
C:\Users\dkhodabakhsh\AppData\Local\Temp
Run
dotnet restore --configFile nuget.config
and notice the error.Then run
dotnet restore
and notice that it restored successfully.Repeat steps 5-7 and notice the error again.
Verbose Logs
Sample Project
TODO
The text was updated successfully, but these errors were encountered: