You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are running Azure DevOps Server on-prem. And for security reason we are not allowing internet access from our build agents. Instead all agents are configured to use internal nuget feeds configured in Artifactory mirroring nuget.org.
In below example i have disabled the access to api.nuget.org on my local laptop. This is being able to reproduce the error locally.
MSBuild version 17.9.4+90725d08d for .NET
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : Could not resolve SDK "Microsoft.VisualStudio.JavaScript.Sdk". Exactly one of the probing messages below indicates why we could not r
esolve the SDK. Investigate and resolve that message to correctly specify the SDK.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" returned null.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : Unable to find package Microsoft.VisualStudio.JavaScript.Sdk. No packages exist with this id in source(s): nuget.org
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.VisualStudio.JavaScript.Sdk" because directory "C:\Program Files
\dotnet\sdk\8.0.200\Sdks\Microsoft.VisualStudio.JavaScript.Sdk\Sdk" did not exist.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : warning : Unable to load the service index for source https://api.nuget.org/v3/index.json.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : warning NU1503: Skipping restore for project 'C:\repo\CST.Klas\cst.klas\cst.klas.esproj'. The project file may be invalid or missing targets
required for restore. [C:\repo\CST.Klas\CST.Klas.sln]
Determining projects to restore...
All projects are up-to-date for restore.
Build FAILED.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : warning : Unable to load the service index for source https://api.nuget.org/v3/index.json.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : warning NU1503: Skipping restore for project 'C:\repo\CST.Klas\cst.klas\cst.klas.esproj'. The project file may be invalid or missing targets
required for restore. [C:\repo\CST.Klas\CST.Klas.sln]
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : Could not resolve SDK "Microsoft.VisualStudio.JavaScript.Sdk". Exactly one of the probing messages below indicates why we could not r
esolve the SDK. Investigate and resolve that message to correctly specify the SDK.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" returned null.
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : Unable to find package Microsoft.VisualStudio.JavaScript.Sdk. No packages exist with this id in source(s): nuget.org
C:\repo\CST.Klas\cst.klas\cst.klas.esproj : error : MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.VisualStudio.JavaScript.Sdk" because directory "C:\Program Files
\dotnet\sdk\8.0.200\Sdks\Microsoft.VisualStudio.JavaScript.Sdk\Sdk" did not exist.
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:18.24
Expected result
I expect that any nuget feed configured should be used when resolving SDK´s as well for custom nuget packages.
MSBuild version 17.9.4+90725d08d for .NET
Determining projects to restore...
All projects are up-to-date for restore.
CST.API.Motor.Klas -> C:\repo\CST.Klas\CST.API.Motor.Klas\bin\Debug\net8.0\CST.API.Motor.Klas.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.10
Work around
To get around this error, i manually have to preload the nuget cache. This so when MSBuildSdks is trying to resolve and dependencies. It do not need to go externally to download the package via api.nuget.org that is blocked.
JohanSpannare
changed the title
dotnet restore failed when api.nuget.org is blocked in firewall and custom feed is provided
[BUG] dotnet restore failed when api.nuget.org is blocked in firewall and custom feed is provided
Apr 26, 2024
Background
We are running Azure DevOps Server on-prem. And for security reason we are not allowing internet access from our build agents. Instead all agents are configured to use internal nuget feeds configured in Artifactory mirroring nuget.org.
In below example i have disabled the access to api.nuget.org on my local laptop. This is being able to reproduce the error locally.
Example
nuget sources
dotnet build
Expected result
I expect that any nuget feed configured should be used when resolving SDK´s as well for custom nuget packages.
Work around
To get around this error, i manually have to preload the nuget cache. This so when MSBuildSdks is trying to resolve and dependencies. It do not need to go externally to download the package via api.nuget.org that is blocked.
The text was updated successfully, but these errors were encountered: