2017-06-01 35 views
1

在travis-ci上调用dotnet restore ./solution.sln时出现错误。如何使用travis-ci在Linux上使用travis-ci构建和运行单元测试Visual Studio 2017 ASP.net .NETCoreApp版本1.1

错误MSB4019:未找到导入的项目“/usr/share/dotnet/sdk/1.0.4/Sdks/Microsoft.Docker.Sdk/Sdk/Sdk.props”。

.travis.yml

language: csharp 
dotnet: 1.0.4 
mono: none 
dist: trusty 
env: DOTNETCORE=1 # optional, can be used to take different code paths in your script 

install: 
    - dotnet restore ./solution.sln --verbosity detailed 

script: 
    - dotnet test --configuration Release --verbosity detailed 

我怎样才能解决这个问题?

回答

1

本地Ubuntu的机器上同样的研究后,我就出来:)

.travis.yml文件我简单的项目有2个单元测试项目的建立和使用特拉维斯-CI运行所有单元测试的罚款。

language: csharp 
dotnet: 1.0.4 
mono: none # is not needed 
dist: trusty # Ubuntu 14.04.5 image 
env: DOTNETCORE=1 # optional, can be used to take different code paths in your script 
addons: 
apt: 
    packages: 
    - libcurl3 # needed for 'dotnet restore' 

install: 
    - dotnet restore ./solution.sln 

script: 
# - dotnet build ./solution.sln --configuration Release 
    - find . -name *.xUnitTests.csproj -exec dotnet test {} --configuration Release \; # build and run xunit tests 
相关问题