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

[Question]: NuGetCommand@2 is failing on MacOS-latest build #20610

Open
1 of 4 tasks
Joost-Jens-Luminis opened this issue Oct 31, 2024 · 0 comments
Open
1 of 4 tasks

[Question]: NuGetCommand@2 is failing on MacOS-latest build #20610

Joost-Jens-Luminis opened this issue Oct 31, 2024 · 0 comments

Comments

@Joost-Jens-Luminis
Copy link

Joost-Jens-Luminis commented Oct 31, 2024

Task name

NuGetCommand@2

Task version

No response

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Macos-Latest

Question

I am making some changes to our pipeline files in order to use the NugetCommand@2 task to restore nuget packages.
This is working fine on the Windows-Latest agent, but on the macos-latest agent (used for our iOS builds) this is failing.

      - task: NuGetCommand@2
        inputs:
          command: "restore"
          restoreSolution: "**/*.sln"
          feedsToUse: "config"
          nugetConfigPath: "nuget.config"  

Does anyone know why?

Our nuget.config file:

<?xml version="1.0" encoding="utf-8"?>
  <configuration>
    <packageSources>
      <clear />
      <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
      <add key="ourserver" value="https://pkgs.dev.azure.com/ourserver/_packaging/ourserver/nuget/v3/index.json" />
      <add key="Skiasharp" value="https://aka.ms/skiasharp-eap/index.json" />
    </packageSources>
	  <packageSourceMapping>
		  <!-- key value for <packageSource> should match key values from <packageSources> element -->
		  <packageSource key="ourserver">
			  <package pattern="ourpackage*" />
		  </packageSource>
		  <packageSource key="Skiasharp">
			  <package pattern="SkiaSharp*" />
			  <package pattern="SkiaSharp.HarfBuzz*" />
			  <package pattern="HarfBuzzSharp*" />
		  </packageSource>
		  <packageSource key="nuget.org">
			  <package pattern="*" />
		  </packageSource>
	  </packageSourceMapping>
</configuration>

The error messages:


/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono /Users/runner/hostedtoolcache/NuGet/6.11.1/x64/nuget.exe restore /Users/runner/work/1/s/ourproject.sln -Verbosity Detailed -NonInteractive -ConfigFile /Users/runner/work/1/Nuget/tempNuGet_42233.config
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018: The "WriteRestoreGraphTask" task failed unexpectedly. [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
NuGet Version: 6.11.1.2
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018: NuGet.Frameworks.NuGet.Frameworks1318503.FrameworkException: Invalid framework identifier ''. [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/15.0/bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.Frameworks.NuGet.Frameworks1318503.NuGetFramework.GetShortFolderName (NuGet.Frameworks.NuGet.Frameworks1318503.IFrameworkNameProvider mappings) [0x0007f] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
MSBuild P2P timeout [ms]: 120000
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.Frameworks.NuGet.Frameworks1318503.NuGetFramework.GetShortFolderName () [0x00006] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild "/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetPropsFile="/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/iko1nqo0.vb7.nugetrestore.props" /p:NuGetRestoreTargets="/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets" /p:RestoreUseCustomAfterTargets="True" /p:DisableCheckingDuplicateNuGetItems="True" /p:RestoreTaskAssemblyFile="/Users/runner/hostedtoolcache/NuGet/6.11.1/x64/nuget.exe" /p:RestoreSolutionDirectory="/Users/runner/work/1/s/" /p:RestoreConfigFile="/Users/runner/work/1/Nuget/tempNuGet_42233.config" /p:SolutionDir="/Users/runner/work/1/s/" /p:SolutionName="ourproject" /p:RestoreBuildInParallel="False" /p:RestoreUseSkipNonexistentTargets="False" /p:NuGetExeSkipSdkAnalysisLevelCheck="True"
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.PackageSpecWriter.WriteMetadataTargetFrameworks (NuGet.RuntimeModel.IObjectWriter writer, NuGet.ProjectModel.ProjectRestoreMetadata msbuildMetadata) [0x0007d] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
NuGet.CommandLine.ExitCodeException: Exception of type 'NuGet.CommandLine.ExitCodeException' was thrown.
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.PackageSpecWriter.SetMSBuildMetadata (NuGet.RuntimeModel.IObjectWriter writer, NuGet.ProjectModel.PackageSpec packageSpec, NuGet.Common.IEnvironmentVariableReader environmentVariableReader) [0x001a4] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
  at NuGet.CommandLine.MsBuildUtility.GetProjectReferencesAsync (NuGet.CommandLine.MsBuildToolset msbuildToolset, System.String[] projectPaths, System.Int32 timeOut, NuGet.CommandLine.IConsole console, System.Boolean recursive, System.String solutionDirectory, System.String solutionName, System.String restoreConfigFile, System.String[] sources, System.String packagesDirectory, NuGet.ProjectModel.RestoreLockProperties restoreLockProperties) [0x004c6] in <03694354d8cf49bbbcff72442919ab34>:0 
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.PackageSpecWriter.Write (NuGet.ProjectModel.PackageSpec packageSpec, NuGet.RuntimeModel.IObjectWriter writer, System.Boolean hashing, NuGet.Common.IEnvironmentVariableReader environmentVariableReader) [0x000ce] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
  at NuGet.CommandLine.RestoreCommand.GetDependencyGraphSpecAsync (System.String[] projectsWithPotentialP2PReferences, System.String solutionDirectory, System.String solutionName, System.String configFile) [0x0012b] in <03694354d8cf49bbbcff72442919ab34>:0 
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.DependencyGraphSpec.Write (NuGet.RuntimeModel.IObjectWriter writer, System.Boolean hashing, System.Action`4[T1,T2,T3,T4] writeAction) [0x000ae] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
  at NuGet.CommandLine.RestoreCommand.DetermineInputsFromMSBuildAsync (NuGet.CommandLine.RestoreCommand+PackageRestoreInputs packageRestoreInputs) [0x000e5] in <03694354d8cf49bbbcff72442919ab34>:0 
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.DependencyGraphSpec.Save (System.IO.Stream stream) [0x0001c] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.DependencyGraphSpec.Save (System.String path) [0x00008] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.Build.Tasks.WriteRestoreGraphTask.Execute () [0x000a3] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <6d7e92f0b36c4dd988a926924f8f8c8c>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002b9] in <6d7e92f0b36c4dd988a926924f8f8c8c>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]

##[error]The nuget command failed with exit code(1) and error(/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018: The "WriteRestoreGraphTask" task failed unexpectedly. [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018: NuGet.Frameworks.NuGet.Frameworks1318503.FrameworkException: Invalid framework identifier ''. [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.Frameworks.NuGet.Frameworks1318503.NuGetFramework.GetShortFolderName (NuGet.Frameworks.NuGet.Frameworks1318503.IFrameworkNameProvider mappings) [0x0007f] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.Frameworks.NuGet.Frameworks1318503.NuGetFramework.GetShortFolderName () [0x00006] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.PackageSpecWriter.WriteMetadataTargetFrameworks (NuGet.RuntimeModel.IObjectWriter writer, NuGet.ProjectModel.ProjectRestoreMetadata msbuildMetadata) [0x0007d] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.PackageSpecWriter.SetMSBuildMetadata (NuGet.RuntimeModel.IObjectWriter writer, NuGet.ProjectModel.PackageSpec packageSpec, NuGet.Common.IEnvironmentVariableReader environmentVariableReader) [0x001a4] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.PackageSpecWriter.Write (NuGet.ProjectModel.PackageSpec packageSpec, NuGet.RuntimeModel.IObjectWriter writer, System.Boolean hashing, NuGet.Common.IEnvironmentVariableReader environmentVariableReader) [0x000ce] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.DependencyGraphSpec.Write (NuGet.RuntimeModel.IObjectWriter writer, System.Boolean hashing, System.Action`4[T1,T2,T3,T4] writeAction) [0x000ae] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.DependencyGraphSpec.Save (System.IO.Stream stream) [0x0001c] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.ProjectModel.DependencyGraphSpec.Save (System.String path) [0x00008] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at NuGet.Build.Tasks.WriteRestoreGraphTask.Execute () [0x000a3] in <03694354d8cf49bbbcff72442919ab34>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <6d7e92f0b36c4dd988a926924f8f8c8c>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets]
/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/jv0bmif5.shx.nugetrestore.targets(210,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002b9] in <6d7e92f0b36c4dd988a926924f8f8c8c>:0  [/var/folders/z0/m_s6x1rn5799ttl3khp8n86r0000gn/T/NuGetScratchrunner/unnentyg.n0b.nugetinputs.targets])
##[error]Packages failed to restore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants