Dotnet core 3.1.1 on Windows

Is it possible to be able to build dotnet core 3.1.1 projects on Windows in Travis?

I have a WPF project build on core 3.1.1 (hence needing a Windows agent) and my travis config file is as follows,

os: windows
language: csharp
mono: none
dotnet: 3.1

script:
- dotnet --version
- dotnet restore
- dotnet build

I receive the following error,

3.1 is either an invalid version of dotnet or unsupported on this operating system.
View valid versions of dotnet at https://docs.travis-ci.com/user/languages/csharp/

According to that page it suggests that any legitimate version of dotnet core should work, or maybe I’m not reading it correctly?

Many thanks for any help in this :slight_smile:

Update

I have got it working by installing dotnet using chocolatey with the following configuration

os: windows
language: csharp
mono: none

script:
- choco install dotnetcore-sdk
- dotnet --version
- dotnet restore

I just upgraded my project to .Net Core 3.1 and it just works for me. Here is how my config looks:

language: csharp
mono: none
dist: xenial
dotnet: 3.1
install:
  - dotnet restore
script:
  - dotnet build
  - dotnet test Tests/DataImporter.Tests/DataImporter.Tests.csproj

This is the url of my repo:

https://travis-ci.org/abulhasanlakhani/DataImporterApi

1 Like