Search code examples
macosxamarin.iosazure-devopstfsbuild

Is it possible to restore Nuget packages with a Xamarin.iOS build using TFS online?


I am trying to automate my build process for my Xamarin.iOS application. I have managed to get a Xamarin.Android and UWP build working find on my on site Windows build agent.

I am now trying to build a Xamarin.iOS application using my On Site Mac build agent.

I have added the Restore Nuget packages as the first step in this build definition but keep getting the error:

MSBuild auto-detection: using msbuild version '4.0' from '/Library/Frameworks/Mono.framework/Versions/4.2.3/lib/mono/4.5'. MsBuild.exe does not exist at '/Library/Frameworks/Mono.framework/Versions/4.2.3/lib/mono/4.5/msbuild.exe'. Error: /usr/local/bin/nuget failed with return code: 1 Return code: 1

But I'm not sure what it's trying to do here at the nuget installer stage.

So is this possible to do?


Solution

  • There is a known issue with nuget restore command on non-Windows operating systems:

    Restore - Restore works with packages.config and project.json files but will not yet work with *.sln solution files

    So you can try to update the "Restore Nuget Packages" step to restore the packages.config file instead of solution file. If it still does not work, then try to change the "Installation type" from "Restore" to "Install".

    NuGet 3.2

    With NuGet 3.2, the following commands have been tested to work:

    Config

    Delete Help Install List Push SetApiKey Sources Spec

    Refer to this link for details: NuGet Compatibility.