Xamarin UWP VSTS NuGet包还原失败

时间:2017-04-07 21:05:18

标签: xamarin uwp nuget azure-pipelines nuget-package-restore

我有一个针对UWP和Android的Xamarin应用程序 - 我决定尝试仅在VSTS中定位UWP。我在packages.config中列出了以下内容:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="CommonServiceLocator" version="1.3" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Corcav.Behaviors" version="2.3.6" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Prism.Core" version="6.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Prism.Forms" version="6.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Prism.Unity.Forms" version="6.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="System.Net.Primitives" version="4.3.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Unity" version="4.0.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Xam.Plugin.Media" version="2.6.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Xam.Plugins.Settings" version="2.5.4" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Xam.Plugins.TextToSpeech" version="2.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" />
  <package id="Xamarin.Forms" version="2.3.3.193" targetFramework="portable45-net45+win8+wp8+wpa81" />
</packages>

我在NuGet包恢复期间首次收到以下错误:

System.IO.Compression 4.1.1 provides a compile-time reference assembly for System.IO.Compression on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
System.Runtime.WindowsRuntime.UI.Xaml 4.0.1 provides a compile-time reference assembly for System.Runtime.WindowsRuntime.UI.Xaml on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
System.Net.Requests 4.0.11 provides a compile-time reference assembly for System.Net.Requests on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot)

但是,我通过将构建版本设置为VS 2017并在VSTS中将NuGet版本从3.3更改为3.5来解决此问题,但现在我遇到了以下错误:

******************************************************************************
Finishing: Get Sources
******************************************************************************
******************************************************************************
Starting: NuGet restore **/*.sln
******************************************************************************
==============================================================================
Task         : NuGet Installer
Description  : Installs or restores missing NuGet packages
Version      : 0.2.29
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
==============================================================================
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 3.5.0.1938 / 3.5.0
SYSTEMVSSCONNECTION exists true
C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe restore -NonInteractive C:\a\1\s\DomoticzHome.sln -NoCache
Failed to load msbuild Toolset
  Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Error: C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
Packages failed to install

我在https://github.com/Microsoft/vsts-tasks/issues/3358看到了对同一错误的引用,但没有解决方案。

如何修复NuGet包还原?

0 个答案:

没有答案