【问题标题】:Build on appveyor .NET Standard 2.0基于 appveyor .NET Standard 2.0 构建
【发布时间】:2017-09-08 16:35:27
【问题描述】:

我将我的项目 (https://github.com/MarkKhromov/The-Log) 迁移到 .NET Standard 2.0,但我的 appveyor 构建已损坏。我该如何解决这个问题?

我的解决方案包含:

  • .NET 标准项目
  • 控制台应用程序项目
  • 类库(测试)项目

我已经试过写了:

dotnet: 2.0.0
script:
  - dotnet restore
  - dotnet build

- dotnet build TheLog/TheLog.csproj -c Release -f netstandard2.0
- msbuild TheLog.Demos/TheLog.Demos.csproj /p:Configuration=Release
- msbuild TheLog.Tests/TheLog.Tests.csproj /p:Configuration=Debug
- nunit-console TheLog.Tests/TheLog.Tests.csproj

但每次我都有错误

【问题讨论】:

    标签: .net-standard appveyor .net-standard-2.0


    【解决方案1】:

    需要更改 AppVeyor 上的两个设置。
    1. 将Build worker image更改为Visual Studio 2017 - 环境设置
    2. 将“dotnet restore”命令添加到Before build script 中作为CMD - 构建设置

    我已经在 .NET Standard 2.0 或 .NET Core 2 上的一个新的空项目/解决方案集上确认了这一点。

    【讨论】:

      【解决方案2】:

      您需要将 appveyor 配置更改为 VS 2017 映像,以便构建 .NET Standard 库并将基于 dotnet 的工具用于 csproj 项目。

      【讨论】:

      • AppVeyor 内置 msbuild 基于构建阶段适用于 Visual Studio 2017 上的 .NET Standard 2.0 项目。但是,是的,应该使用基于dotnet 的工具来执行测试。
      • 我查看了您在 master 上最新提交的构建日志,它使用的是 msbuild 14,所以我认为您尚未选择 2017 年的映像。顺便说一句,测试执行是通过 msbuild 还是 dotnet 完成都没有关系,两者都调用 VSTest msbuild 目标。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多