1

I'm trying to build a solution in Travis CI with two kinds of projects, .Net Core and .Net Framework, but I haven't achieved it, it can build a solution with only .Net Framework or only .Net Core projects, but not for both in the same solution.

I appreciate if someone already has dealt with the same problem and can help me.

Thanks!

2 Answers2

1

I created a standard build for .Net Framework projects and in order to build the .Net Core projects in the same solution, I just created a some post-build commands like this:

dotnet restore EFCore.DbContextFactory.Examples.Data/EFCore.DbContextFactory.Examples.Data.csproj --verbosity m

dotnet restore EFCore.DbContextFactory.Examples.WebApi/EFCore.DbContextFactory.Examples.WebApi.csproj --verbosity m

dotnet restore EFCore.DbContextFactory/EFCore.DbContextFactory.csproj --verbosity m

dotnet publish EFCore.DbContextFactory.Examples.Data/EFCore.DbContextFactory.Examples.Data.csproj

dotnet publish EFCore.DbContextFactory.Examples.WebApi/EFCore.DbContextFactory.Examples.WebApi.csproj

dotnet publish EFCore.DbContextFactory/EFCore.DbContextFactory.csproj

Then for unit test I'm using that command to execute the tests and generate the results file:

dotnet test  EF.DbContextFactory.UnitTest.Data\EF.DbContextFactory.UnitTest.Data.csproj --logger "trx;LogFileName=output.trx"

So lastly I publish the tests results on appveyor (Powershell):

$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path EF.DbContextFactory.UnitTest.Data\\TestResults\output.trx))

And that's it. BTW in order to restore the nuget packages I have this before build script:

nuget restore
0

Look at appveyor (https://www.appveyor.com/), a CI service for Windows builds

StephenG
  • 2,851
  • 1
  • 16
  • 36
  • That was my first option but at that moment I was trying to integrate a private repository on VSTS with appveyor free account and it's not possible, so now I created a build in appveyor from Github directly. – Geovanny Alzate Sandoval Dec 15 '17 at 00:16