Closed robintschroeder closed 3 years ago
It looks like nuget.org isn't in the nuget.config file you have?
OK - now I am embarrassed... but hopefully this post helps someone else...
Added this to my nuget.config and the pipeline finds MSBuild.Sdk.Extras just fine - duh!
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
Just ran into this when building a xamarin android project. My solution: updated the restore command in yml before building.
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
command: 'restore'
restoreSolution: '$(RestoreSolution)'
feedsToUse: 'config'
- task: VSBuild@1
displayName: 'Build Droid'
...
Something has changed recently in either Net5.0 SDK or MSBuild 16.9. Now it only check for the first nuget source and fail after that if the sdk is not present in this source. In my Azure DevOps the first source seems to be "Microsoft Visual Studio Offline Package" which of course doesn't contain the SDK. Adding a step to remove this source before nuget restore fixed the issue for me.
- script: dotnet nuget remove source "Microsoft Visual Studio Offline Packages"
None of the above works for me. Can somebody please post a working yaml ?
FYI.
I came across this thread after having the same issue with Xamarin and VS2022 on my local PC.
The fix that worked was changing my project from <Project Sdk="MSBuild.Sdk.Extras">
to <Project Sdk="MSBuild.Sdk.Extras/3.0.23">
.
I am trying to build a Xamarin plugin in Azure DevOps. The same project builds perfectly on my laptop. I have a brand new cloud hosted Agent Pool running windows-latest / VS2019 image, created today.
In the YAML, I am explicitly calling for msbuild:
In the project file (because I only have one project):
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
In the project, I have a global.json:
I have tried a number of variations with and without the global.json, and also with different versions of the sdks. No luck.
The pipeline fails while restoring the MSBuild.Sdk.Extras nuget. I verified that C:\Program Files\dotnet\sdk\5.0.104 exists on the agent pool server, but it seems like it can't get the MSBuild.Sdk.Extras. I see the service index warning, but isn't it already connected?? Any help would be appreciated!