Skip to content

Instantly share code, notes, and snippets.

@timabell
Last active January 3, 2024 05:59
Show Gist options
  • Save timabell/279823d5433176f24d170ef9c43d797e to your computer and use it in GitHub Desktop.
Save timabell/279823d5433176f24d170ef9c43d797e to your computer and use it in GitHub Desktop.
#!/bin/sh
# run with `source fix-omnisharp-asdf.sh` to ensure environment variables are made available
# https://stackoverflow.com/questions/70820780/vscode-or-anothers-editors-dont-recognize-sdk-dotnet-installed-with-asdf/70820974#70820974
# tell omnisharp where to find the current dotnet sdk installed by asdf-vm
version=`asdf current dotnet-core | awk '{print $2}'`
echo "Parsed version: $version"
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=$(echo $HOME/.asdf/installs/dotnet-core/$version/sdk/$version/Sdks)
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER=$version
export DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$(echo $HOME/.asdf/installs/dotnet-core/$version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment