Background
I recently converted my Xamarin.Forms app from PCL to Net Standard format.
All of my projects now use PackageReference
in the csproj
file. Which means no more package.config
or package.json
.
We use TFS 2015 to build, sign, package our .ipa
and .apk
files. After conversion, the default MSBUILD build steps do not work as they look for mdtool
and the new Visual Studio has vstool
instead. So, I updated the build steps to use new tools via command line.
All my projects are NetStandard now (including iOS and Android).
Issue
I can successfully restore NuGet packages using restore MySolution.sln -force
on Mac build server. But when I run vstool build MySolution.sln
after that, I get this error:
error: NuGet packages need to be restored before building. NuGet MSBuild targets are missing and are needed for building. The NuGet MSBuild targets are generated when the NuGet packages are restored.
I am able to successfully run the nuget restore
and vstool build
locally on the build machine. But only when TFS runs the command via agent, it shows that error message.
Setup
Builds: TFS 2015 on Mac agent running Visual Studio 7.5
msbuild /t:restore yoursolution.sln
to restore a .NET Standard project. – Matt Wardmsbuild /t:restore My.sln
fails with error,/NuGet.targets(104,5): error : '1.0.0$(rev:r)' is not a valid version string.
on all Net Standard projects. (which is the version set by my build configuration) so, usingnuget restore My.sln
only restores PCL packages. It shows the warning,NETCore and UAP projects will be skipped, only packages.config files will be restored.
Also, nobin
andobj
folders exist on the server because restore and build fails. – hnabbasi