在appveyor .NET Standard 2.0上构建

问题描述 投票:2回答:2

我将我的项目(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
2个回答
4
投票

您需要将您的appveyor配置更改为VS 2017图像,以便构建.NET标准库并使用基于dotnet的工具来管理csproj项目。


11
投票

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

我已经在.NET Standard 2.0或.NET Core 2上设置了一个新的空项目/解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.