当我尝试使用Azure Pipelines时,我不断收到此错误。
我正在托管的VS2017池上运行它。
这是我构建的管道:
我不断收到的错误显示在以下日志中:
2019-04-30T12:13:03.1506572Z =============================================================================
2019-04-30T12:13:03.1506616Z Task : .NET Core
2019-04-30T12:13:03.1506659Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2019-04-30T12:13:03.1506705Z Version : 2.150.1
2019-04-30T12:13:03.1506734Z Author : Microsoft Corporation
2019-04-30T12:13:03.1506782Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2019-04-30T12:13:03.1506811Z ==============================================================================
2019-04-30T12:13:03.7965121Z [command]C:\windows\system32\chcp.com 65001
2019-04-30T12:13:03.8059420Z Active code page: 65001
2019-04-30T12:13:03.8489997Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\SLDatatHighway.Tests\SLDatatHighway.Tests.csproj
2019-04-30T12:13:04.1500736Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-04-30T12:13:04.1501599Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-04-30T12:13:04.1501793Z
2019-04-30T12:13:04.8585498Z Restoring packages for D:\a\1\s\SLDatatHighway.Tests\SLDatatHighway.Tests.csproj...
2019-04-30T12:13:05.0444966Z Restore completed in 185.75 ms for D:\a\1\s\SLDatatHighway.Tests\SLDatatHighway.Tests.csproj.
2019-04-30T12:13:07.0489863Z SLDatatHighway.Tests -> D:\a\1\s\SLDatatHighway.Tests\bin\Debug\netstandard2.0\SLDatatHighway.Tests.dll
2019-04-30T12:13:07.0572034Z
2019-04-30T12:13:07.0572433Z Build succeeded.
2019-04-30T12:13:07.0572907Z 0 Warning(s)
2019-04-30T12:13:07.0573263Z 0 Error(s)
2019-04-30T12:13:07.0573380Z
2019-04-30T12:13:07.0573422Z Time Elapsed 00:00:02.84
2019-04-30T12:13:07.0915364Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\SL_DataHighway.Tests\SL_DataHighway.Tests.csproj
2019-04-30T12:13:07.3764095Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-04-30T12:13:07.3807448Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-04-30T12:13:07.3807518Z
2019-04-30T12:13:08.1015074Z Restoring packages for D:\a\1\s\SL_DataHighway.Tests\SL_DataHighway.Tests.csproj...
2019-04-30T12:13:08.7878736Z Restore completed in 484.69 ms for D:\a\1\s\SL_DataHighway.Tests\SL_DataHighway.Tests.csproj.
2019-04-30T12:13:14.0395526Z SL_DataHighway.Tests -> D:\a\1\s\SL_DataHighway.Tests\bin\Debug\netcoreapp2.1\SL_DataHighway.Tests.dll
2019-04-30T12:13:14.0481411Z
2019-04-30T12:13:14.0482045Z Build succeeded.
2019-04-30T12:13:14.0483401Z 0 Warning(s)
2019-04-30T12:13:14.0483487Z 0 Error(s)
2019-04-30T12:13:14.0483908Z
2019-04-30T12:13:14.0484034Z Time Elapsed 00:00:06.60
2019-04-30T12:13:14.0864499Z [command]"C:\Program Files\dotnet\dotnet.exe" build D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj
2019-04-30T12:13:14.3705111Z Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
2019-04-30T12:13:14.3705588Z Copyright (C) Microsoft Corporation. All rights reserved.
2019-04-30T12:13:14.3705720Z
2019-04-30T12:13:14.8626284Z Nothing to do. None of the projects specified contain packages to restore.
2019-04-30T12:13:15.3736897Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". 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\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.3779682Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". 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\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4465770Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2729,5): error MSB4062: The "Microsoft.Build.Tasks.ResolveComReference" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4550056Z
2019-04-30T12:13:15.4554234Z Build FAILED.
2019-04-30T12:13:15.4554556Z
2019-04-30T12:13:15.4574427Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". 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\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4579425Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL". 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\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4580177Z C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(2729,5): error MSB4062: The "Microsoft.Build.Tasks.ResolveComReference" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj]
2019-04-30T12:13:15.4583312Z 2 Warning(s)
2019-04-30T12:13:15.4583865Z 1 Error(s)
2019-04-30T12:13:15.4585281Z
2019-04-30T12:13:15.4585654Z Time Elapsed 00:00:01.01
2019-04-30T12:13:15.4950879Z ##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
2019-04-30T12:13:15.4960391Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\SL_Data_Highway_App\SL_Data_Highway_App.csproj
2019-04-30T12:13:15.4994396Z ##[section]Finishing: dotnet build
2019-04-30T12:13:15.5009622Z ##[section]Starting: Checkout
2019-04-30T12:13:15.5109587Z ==============================================================================
2019-04-30T12:13:15.5109634Z Task : Get sources
2019-04-30T12:13:15.5109671Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2019-04-30T12:13:15.5109870Z Version : 1.0.0
2019-04-30T12:13:15.5109906Z Author : Microsoft
2019-04-30T12:13:15.5109940Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2019-04-30T12:13:15.5109992Z ==============================================================================
2019-04-30T12:13:15.9176300Z Cleaning any cached credential from repository: SL-DataHighway (Git)
2019-04-30T12:13:15.9266683Z ##[section]Finishing: Checkout
2019-04-30T12:13:15.9371889Z ##[section]Starting: Finalize Job
2019-04-30T12:13:15.9414810Z Start cleaning up orphan processes.
2019-04-30T12:13:15.9425504Z ##[section]Finishing: Finalize Job
2019-04-30T12:13:15.9475730Z ##[section]Finishing: Job
通过Visual Studio 2017构建可以正常工作。问题只有当我尝试通过Azure管道进行构建时。
是否缺少某些内容或输入了错误的内容? 这是我的项目中参考文献的概述。如您所见,Outlook Interop和Office参考都是很好的参考。
我的packages.config文件如下:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Office.Interop.Outlook" version="15.0.4797.1003" targetFramework="net461" />
</packages>
提前谢谢!
编辑:添加了池,添加了packages.config概述