template-dotnet-core-cli-csharp
template-dotnet-core-cli-csharp copied to clipboard
If I use net core 3 1. How to set gitpod
If I use net core 3 1. How to set gitpod
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.
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 I was thinking of using a custom Dockerfile instead of the init; would that work / be cached across builds?
Yea if you used a Dockerfile to install it then that would work just fine!