<p>OK - found the solution myself. It's a kind of tricky one. Even though my project is written in F#, I still have to set</p>

<p><code>"language": "csharp"</code></p>

<p>in my .travis.yml file. That's a bit counter-intuitive, but I must admit that it's written in the doc, so can't really blame anyone.</p>

CC BY-SA 4.0
2019-01-25T16:35:39.980Z
I'd give you multiple upvotes if I could.  I would have never discovered that on my own.
Nathan Wilson
CC BY-SA 4.0
2018-10-08T23:12:29.343Z
2018-10-08T23:12:29.343Z
LA.27
<p>I'm new to both travis and this website, so please bear with me ;). </p>

<p>I've been trying to set it up to work with my GH project. The repo is visible on travis side, but I get the following error while building:</p>

<p><code>./fake.sh: line 25: dotnet: command not found</code></p>

<p>Not sure why - most likely I've done something wrong with my .travis file. Here it is:</p>

<pre><code>{
  "os": "linux",
  "dist": "trusty",
  "mono": "5.10.1",
  "sudo": "required",
  "group": "stable",
  "dotnet": "2.1.403",
  "script": [
  -  "./fake.sh build -t Nuget"
  ],
  "install": [
  -  "export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/"
  ],
  "language": "fsharp",
  "before_install": [
  - "chmod +x fake.sh"
  ]
}
</code></pre>

<p>The file "fake.sh" is my build script. It uses the F# FAKE library, but the target I invoke contains nothing, but invocation of "dotnet pack". It works on my local machine.</p>

<p>EDIT: 
The fake.sh is the standard, unchanged F# FAKE file that is included in "dotnet new fake" template. Here's its content:</p>

<pre><code>#!/usr/bin/env bash

set -eu
set -o pipefail

# liberated from https://stackoverflow.com/a/18443300/433393
realpath() {
  OURPWD=$PWD
  cd "$(dirname "$1")"
  LINK=$(readlink "$(basename "$1")")
  while [ "$LINK" ]; do
    cd "$(dirname "$LINK")"
    LINK=$(readlink "$(basename "$1")")
  done
  REALPATH="$PWD/$(basename "$1")"
  cd "$OURPWD"
  echo "$REALPATH"
}

TOOL_PATH=$(realpath .fake)
FAKE="$TOOL_PATH"/fake

if ! [ -e "$FAKE" ]
then
  dotnet tool install fake-cli --tool-path "$TOOL_PATH"
fi
"$FAKE" "$@"
</code></pre>

<p>All it does is it makes sure all the build requirements are there in place. Then it runs the "build.fsx" script:</p>

<pre><code>open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators

let nugetDir = "../nuget"

Target.create "Clean" (fun _ -&gt;
    !! "src/**/bin"
    ++ "src/**/obj"
    ++ nugetDir
    |&gt; Shell.cleanDirs 
)

Target.create "Build" (fun _ -&gt;
    !! "src/**/*.*proj"
    |&gt; Seq.iter (DotNet.build id)
)

Target.create "Nuget" (fun _ -&gt;
    !! "src/**/*.*proj"
    |&gt; Seq.iter (DotNet.pack (fun o -&gt; { o with OutputPath = Some nugetDir }))
)

"Clean"
  ==&gt; "Build"

"Clean"
  ==&gt; "Nuget"

Target.runOrDefault "Build"
</code></pre>

CC BY-SA 4.0
2018-10-08T03:52:40.543Z
post here entry of fake.sh
Meiram Chuzhenbayev
CC BY-SA 4.0
2018-10-08T07:02:51.303Z
Sure - updated the question.
LA.27
<travis-ci><dotnet>
dotnet not found on travis for an F# project
LA.27
# dotnet not found on travis for an F# project

(Asked by: username_0 on 2018-10-07)

I'm new to both travis and this website, so please bear with me ;). 
I've been trying to set it up to work with my GH project. The repo is visible on travis side, but I get the following error while building:
./fake.sh: line 25: dotnet: command not found
Not sure why - most likely I've done something wrong with my .travis file. Here it is:
{
  "os": "linux",
  "dist": "trusty",
  "mono": "5.10.1",
  "sudo": "required",
  "group": "stable",
  "dotnet": "2.1.403",
  "script": [
  -  "./fake.sh build -t Nuget"
  ],
  "install": [
  -  "export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/"
  ],
  "language": "fsharp",
  "before_install": [
  - "chmod +x fake.sh"
  ]
}

The file "fake.sh" is my build script. It uses the F# FAKE library, but the target I invoke contains nothing, but invocation of "dotnet pack". It works on my local machine.
EDIT: 
The fake.sh is the standard, unchanged F# FAKE file that is included in "dotnet new fake" template. Here's its content:
#!/usr/bin/env bash

set -eu
set -o pipefail

# liberated from https://stackoverflow.com/a/18443300/433393
realpath() {
  OURPWD=$PWD
  cd "$(dirname "$1")"
  LINK=$(readlink "$(basename "$1")")
  while [ "$LINK" ]; do
    cd "$(dirname "$LINK")"
    LINK=$(readlink "$(basename "$1")")
  done
  REALPATH="$PWD/$(basename "$1")"
  cd "$OURPWD"
  echo "$REALPATH"
}

TOOL_PATH=$(realpath .fake)
FAKE="$TOOL_PATH"/fake

if ! [ -e "$FAKE" ]
then
  dotnet tool install fake-cli --tool-path "$TOOL_PATH"
fi
"$FAKE" "$@"

All it does is it makes sure all the build requirements are there in place. Then it runs the "build.fsx" script:
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators

let nugetDir = "../nuget"

Target.create "Clean" (fun _ ->
    !! "src/**/bin"
    ++ "src/**/obj"
    ++ nugetDir
    |> Shell.cleanDirs 
)

Target.create "Build" (fun _ ->
    !! "src/**/*.*proj"
    |> Seq.iter (DotNet.build id)
)

Target.create "Nuget" (fun _ ->
    !! "src/**/*.*proj"
    |> Seq.iter (DotNet.pack (fun o -> { o with OutputPath = Some nugetDir }))
)

"Clean"
  ==> "Build"

"Clean"
  ==> "Nuget"

Target.runOrDefault "Build"

**Tags:** travis-ci, dotnet

> **Comments:**
> **username_1**: post here entry of fake.sh  
> **username_0**: Sure - updated the question.  

---

## 1 answers

### Answer by username_0 on 2018-10-08. Score: 2 | Accepted answer

OK - found the solution myself. It's a kind of tricky one. Even though my project is written in F#, I still have to set

`"language": "csharp"`

in my .travis.yml file. That's a bit counter-intuitive, but I must admit that it's written in the doc, so can't really blame anyone.

> **Comments:**
> **username_2**: I'd give you multiple upvotes if I could.  I would have never discovered that on my own.  

---

