template-dotnet-core-cli-csharp icon indicating copy to clipboard operation
template-dotnet-core-cli-csharp copied to clipboard

If I use net core 3 1. How to set gitpod

Open bbhxwl opened this issue 3 years ago • 4 comments

If I use net core 3 1. How to set gitpod

bbhxwl avatar May 10 '22 16:05 bbhxwl

This works for me:

# requires ubuntu 20.02
image: gitpod/workspace-dotnet:2023-01-10-16-35-53

# List the start up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks
tasks:
  - name: Dotnet Run
    init: |  # runs during prebuild => https://www.gitpod.io/docs/configure/projects/prebuilds
      curl -fsSL https://download.visualstudio.microsoft.com/download/pr/f65a8eb0-4537-4e69-8ff3-1a80a80d9341/cc0ca9ff8b9634f3d9780ec5915c1c66/dotnet-sdk-3.1.201-linux-x64.tar.gz | tar xz -C /home/gitpod/dotnet
      dotnet restore

The key is using Ubuntu 20.02 (22 isn't supported AFAIK) and extracting binary to the /home/gitpod/dotnet directory.

Binaries Direct Link (Linux | x64): https://dotnet.microsoft.com/en-us/download/dotnet/3.1

Obviously will want to upgrade to 6/7 LTS but for now, needed to get it working without upgrading the repository.

kamranayub avatar Apr 05 '23 14:04 kamranayub

It's important to note that only stuff in the /workspace directory is saved, if you use prebuilds or your workspace stops then the dotnet install wouldn't be saved since it's in /home/gitpod/dotnet

ghostdevv avatar Apr 05 '23 15:04 ghostdevv

@ghostdevv I was thinking of using a custom Dockerfile instead of the init; would that work / be cached across builds?

kamranayub avatar Apr 05 '23 15:04 kamranayub

Yea if you used a Dockerfile to install it then that would work just fine!

ghostdevv avatar Apr 07 '23 12:04 ghostdevv