【问题标题】:VSTS CI build with Xamarin.Form fail finding MVVMLight assembly使用 Xamarin.Form 构建 VSTS CI 无法找到 MVVMLight 程序集
【发布时间】:2018-05-14 19:27:58
【问题描述】:

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

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

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

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.

构建摘要

Prototype.MyProject.Controls\AutoForm\AutoFormPickerItem.cs (3, 18)
Prototype.MyProject.Controls\AutoForm\AutoFormPickerItem.cs(3,18): Warning CS0659: 'AutoFormPickerItem' overrides Object.Equals(object o) but does not override Object.GetHashCode()
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (2052, 5)
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.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (2052, 5)
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.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (2052, 5)
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.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (2052, 5)
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.
Prototype.MyProject\Prototype.MyProject\App.xaml.cs (6, 7)
Prototype.MyProject\Prototype.MyProject\App.xaml.cs(6,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\App.xaml.cs (7, 7)
Prototype.MyProject\Prototype.MyProject\App.xaml.cs(7,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Authentications\LoginViewModel.cs (3, 7)
Prototype.MyProject\Prototype.MyProject\Features\Authentications\LoginViewModel.cs(3,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Configurations\UserPerferenceViewModel.cs (2, 7)
Prototype.MyProject\Prototype.MyProject\Features\Configurations\UserPerferenceViewModel.cs(2,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainDetailViewModel.cs (4, 7)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainDetailViewModel.cs(4,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainMasterViewModel.cs (6, 7)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainMasterViewModel.cs(6,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainMasterViewModel.cs (7, 7)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainMasterViewModel.cs(7,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainView.xaml.cs (3, 7)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainView.xaml.cs(3,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainViewModel.cs (3, 7)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainViewModel.cs(3,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainViewModel.cs (4, 7)
Prototype.MyProject\Prototype.MyProject\Features\Main\MainViewModel.cs(4,7): Error CS0246: The type or namespace name 'GalaSoft' could not be found (are you missing a using directive or an assembly reference?)

我确实选择了解决方案来将包恢复到我的项目解决方案 .sln 文件.... 内置代理队列 Hosted VS2017....

我做错了什么? :/

【问题讨论】:

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


    【解决方案1】:

    这是我的错,在我的项目中有 nuget 包和引用的 MvvmLight(不是网络标准)包。

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

    我删除了所有引用并为 .net 标准包安装了 MvvmLight,它现在可以工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-21
      • 2014-08-28
      • 1970-01-01
      • 2018-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多