使用Xamarin.Form的VSTS CI构建无法找到MVVMLight程序集

时间:2018-05-14 10:29:03

标签: xamarin.forms xamarin.android azure-devops azure-pipelines

我正在尝试在VSTS上设置CI-Build,在NuGet Restore进程中我可以看到找到的MvvmLight包。

<p
  class="employer__image"
  style='background-image: url("image.jpeg")'>
</p>

但是,在Build Xamarin.Android项目过程中,它给出了以下错误:

2018-05-14T09:57:17.0372995Z Installing WebP.Touch 1.0.8.
2018-05-14T09:57:17.0373097Z Lock not required - Package already installed Xamarin.Forms 3.0.0.446417
2018-05-14T09:57:17.0373227Z Acquiring lock for the installation of MvvmLight 5.4.1
2018-05-14T09:57:17.0373328Z Acquired lock for the installation of MvvmLight 5.4.1
2018-05-14T09:57:17.0373530Z Installing MvvmLight 5.4.1.
2018-05-14T09:57:17.0373650Z Acquiring lock for the installation of Newtonsoft.Json 11.0.2
2018-05-14T09:57:17.0373759Z Lock not required - Package already installed Newtonsoft.Json 11.0.2
2018-05-14T09:57:17.0373876Z Acquiring lock for the installation of AiForms.Effects 1.3.0
2018-05-14T09:57:17.0373985Z Lock not required - Package already installed AiForms.Effects 1.3.0
2018-05-14T09:57:17.0374117Z Acquiring lock for the installation of CommonServiceLocator 2.0.2

构建摘要

2018-05-14T09:57:57.6037827Z ResolveAssemblyReferences:
2018-05-14T09:57:57.6038210Z   Primary reference "CommonServiceLocator".
2018-05-14T09:57:57.6040567Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "CommonServiceLocator". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2018-05-14T09:57:57.6041769Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "CommonServiceLocator". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\Prototype.MyProject\Prototype.MyProject\Prototype.MyProject.csproj]
2018-05-14T09:57:57.6042157Z           For SearchPath "{HintPathFromItem}".
2018-05-14T09:57:57.6042375Z           Considered "..\..\..\..\..\.nuget\packages\commonservicelocator\2.0.2\lib\netstandard2.0\CommonServiceLocator.dll", but it didn't exist.
2018-05-14T09:57:57.6042987Z           For SearchPath "{RawFileName}".
2018-05-14T09:57:57.6043207Z           Considered treating "CommonServiceLocator" as a file name, but it didn't exist.
2018-05-14T09:57:57.6043403Z   Primary reference "GalaSoft.MvvmLight".
2018-05-14T09:57:57.6044903Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2018-05-14T09:57:57.6045643Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\Prototype.MyProject\Prototype.MyProject\Prototype.MyProject.csproj]
2018-05-14T09:57:57.6046483Z           For SearchPath "{HintPathFromItem}".
2018-05-14T09:57:57.6046710Z           Considered "..\..\..\..\..\.nuget\packages\mvvmlightlibs\5.4.1\lib\xamarin.ios10\GalaSoft.MvvmLight.dll", but it didn't exist.
2018-05-14T09:57:57.6046899Z           For SearchPath "{RawFileName}".
2018-05-14T09:57:57.6047274Z           Considered treating "GalaSoft.MvvmLight" as a file name, but it didn't exist.
2018-05-14T09:57:57.6047474Z   Primary reference "GalaSoft.MvvmLight.Extras".
2018-05-14T09:57:57.6048778Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight.Extras". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2018-05-14T09:57:57.6049488Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight.Extras". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\Prototype.MyProject\Prototype.MyProject\Prototype.MyProject.csproj]
2018-05-14T09:57:57.6049822Z           For SearchPath "{HintPathFromItem}".
2018-05-14T09:57:57.6050030Z           Considered "..\..\..\..\..\.nuget\packages\mvvmlightlibs\5.4.1\lib\xamarin.ios10\GalaSoft.MvvmLight.Extras.dll", but it didn't exist.
2018-05-14T09:57:57.6050733Z           For SearchPath "{RawFileName}".
2018-05-14T09:57:57.6051030Z           Considered treating "GalaSoft.MvvmLight.Extras" as a file name, but it didn't exist.
2018-05-14T09:57:57.6051196Z   Primary reference "GalaSoft.MvvmLight.Platform".
2018-05-14T09:57:57.6052423Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight.Platform". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2018-05-14T09:57:57.6053730Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "GalaSoft.MvvmLight.Platform". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\1\s\Prototype.MyProject\Prototype.MyProject\Prototype.MyProject.csproj]
2018-05-14T09:57:57.6054102Z           For SearchPath "{HintPathFromItem}".
2018-05-14T09:57:57.6054327Z           Considered "..\..\..\..\..\.nuget\packages\mvvmlightlibs\5.4.1\lib\xamarin.ios10\GalaSoft.MvvmLight.Platform.dll", but it didn't exist.
2018-05-14T09:57:57.6054916Z           For SearchPath "{RawFileName}".
2018-05-14T09:57:57.6055155Z           Considered treating "GalaSoft.MvvmLight.Platform" as a file name, but it didn't exist.
2018-05-14T09:57:57.6235802Z GenerateTargetFrameworkMonikerAttribute:
2018-05-14T09:57:57.6236351Z Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.

我确实选择了将软件包还原到我的项目解决方案的解决方案.sln文件.... 使用代理队列构建托管VS2017 ....

我做错了什么? :/

1 个答案:

答案 0 :(得分:0)

这是我的不好,在我的项目中有nuget包,引用了MvvmLight(非标准)包。

然后在我的代码中,我直接通过dll引用(通过Resharper的帮助,我认为是由nuget包引用)

我删除了所有引用并为.net标准包安装了MvvmLight,它现在正在运行。