# .NET Core sdk installed on every build

**URL:** https://travis-ci.community/t/net-core-sdk-installed-on-every-build/2836
**Category:** C#
**Tags:** build-env
**Created:** [March 29, 2019, 7:20am UTC](https://travis-ci.community/t/net-core-sdk-installed-on-every-build/2836 "2019-03-29T07:20:19Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![alsami](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/alsami/32/1471_2.png) [@alsami](https://travis-ci.community/u/alsami)
#### Post date: [August 9, 2019, 6:57am UTC](https://travis-ci.community/t/net-core-sdk-installed-on-every-build/2836/12 "2019-08-09T06:57:47Z")

</div>

I had the need to use .NET-Core preview and found this [post](https://travis-ci.community/t/net-core-3-0-preview/1936/6)

Using snap is some what faster. Snap is installed once but for each step dotnet is installed. For releases I am saving around two minutes.

Here a sample with multiple steps

```auto
sudo: required
dist: bionic
language: csharp
solution: Etdb.ServiceBase.AspNetCore.sln
mono: none
addons:
  snaps:
    - name: dotnet-sdk
      classic: true
      channel: latest/beta
stages:
  - build
  - test
  - publish
jobs:
  include:
    - stage: build
      name: build solution
      before_script:
        - sudo snap alias dotnet-sdk.dotnet dotnet
      script: dotnet restore && dotnet build
    - stage: test
      name: run-tests
      services: mongodb
      before_script:
        - sudo snap alias dotnet-sdk.dotnet dotnet
        - sh install_link_libgdiplus.sh
        - sh setup-mongodb-user.sh "$MONGODB_USERNAME" "$MONGODB_PASSWORD"
      script: ./run-tests.sh
    - stage: publish
      name: publish-packages
      if: tag IS present
      before_script:
        - sudo snap alias dotnet-sdk.dotnet dotnet
      script: ./publish-packages.sh "$NUGET_SOURCE" "$ETDB_NUGET_APIKEY" "$TRAVIS_TAG"

```

---

_[View the full topic](https://travis-ci.community/t/net-core-sdk-installed-on-every-build/2836)._
