为ASP.NET Core Devextreme项目设置VSTS持续集成(CI)

时间:2017-11-17 13:56:20

标签: continuous-integration azure-devops azure-pipelines asp.net-core-1.0 devextreme

我尝试在VSTS中为使用Devextreme开发的ASP.NET核心项目设置持续集成(CI)。

我已经检查了项目中的NuGet.config文件,似乎是devextreme-controls-netcore是从本地机器引用的。

NuGet.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="devextreme-controls-netcore" value="C:\Program Files (x86)\DevExpress 17.1\DevExtreme\System\DevExtreme\Bin\AspNetCore" />
  </packageSources>
</configuration>

我已在VSTS中为此项目创建了一个构建定义,并将构建排队。我在恢复软件包时遇到错误。

VS的日志文件:

2017-11-17T11:26:33.0089440Z ##[section]Starting: Restore
2017-11-17T11:26:33.0279221Z ==============================================================================
2017-11-17T11:26:33.0279221Z Task         : .NET Core
2017-11-17T11:26:33.0279221Z Description  : Build, test and publish using dotnet core command-line.
2017-11-17T11:26:33.0279221Z Version      : 1.0.2
2017-11-17T11:26:33.0279221Z Author       : Microsoft Corporation
2017-11-17T11:26:33.0279221Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2017-11-17T11:26:33.0279221Z ==============================================================================
2017-11-17T11:26:34.6038344Z [command]"C:\Program Files\dotnet\dotnet.exe" restore d:\a\3\s\DevExtremeAspNetCoreApp\DevExtremeAspNetCoreApp.csproj
2017-11-17T11:26:42.2434595Z   Restoring packages for d:\a\3\s\DevExtremeAspNetCoreApp\DevExtremeAspNetCoreApp.csproj...
2017-11-17T11:26:42.2434595Z   Restoring packages for d:\a\3\s\DevExtremeAspNetCoreApp\DevExtremeAspNetCoreApp.csproj...
2017-11-17T11:26:42.2434595Z C:\Program Files\dotnet\sdk\2.0.2\NuGet.targets(102,5): **error : The local source 'C:\Program Files (x86)\DevExpress 17.1\DevExtreme\System\DevExtreme\Bin\AspNetCore' doesn't exist.** [d:\a\3\s\DevExtremeAspNetCoreApp\DevExtremeAspNetCoreApp.csproj]
2017-11-17T11:26:42.6496133Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2017-11-17T11:26:42.6496133Z ##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\3\s\DevExtremeAspNetCoreApp\DevExtremeAspNetCoreApp.csproj
2017-11-17T11:26:42.6536144Z ##[section]Finishing: Restore

如何构建devextreme-controls-netcore是VSTS来设置CI。

请提供解决方案以解决此问题。

3 个答案:

答案 0 :(得分:1)

您正在引用本地路径(C:\Program Files (x86)\DevExpress 17.1\DevExtreme\System\DevExtreme\Bin\AspNetCore)。如果构建代理上不存在该路径,则构建将失败。

最好的解决方案是在VSTS中设置包Feed,将包上传到该包,然后更新项目以从私有包Feed中提取包。

答案 1 :(得分:1)

首先,基于此线程:DevExtreme.AspNet.Core is not available in NuGet repository,核心包在其私有NuGet存储库(https://nuget.devexpress.com/{feed-authorization-key}/api)上发布,因此如果您拥有授权,则可以从该私有NuGet存储库中检索包键。

其次,您可以将相关的包(在C:\Program Files (x86)\DevExpress 17.1\DevExtreme\System\DevExtreme\Bin\AspNetCore中)添加到源代码控制中,然后将其映射到构建代理(获取源代码)并更改NuGet.config中的值。

另一种方式是丹尼尔说,将其上传到您的VSTS套餐供稿。

答案 2 :(得分:1)

我创建了一个nuget.config并在VSTS构建步骤“nuget restore”中选择了它。 例如:

<configuration>
          <packageRestore>
            <add key="enabled" value="True" />
            <add key="automatic" value="True" />
          </packageRestore>
          <activePackageSource>
            <add key="All" value="(Aggregate source)" />
          </activePackageSource>
          <packageSources>
            <add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
            <add key="DevExpress package source" value="https://nuget.devexpress.com/{yourKeyHere}/api" />
          </packageSources>
        </configuration>