2017-06-01 32 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 
相關問題