Skip to content

Instantly share code, notes, and snippets.

@timabell
Last active April 17, 2025 21:31

Revisions

  1. timabell revised this gist Mar 19, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion fix-omnisharp-asdf.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/sh -v
    #!/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
  2. timabell created this gist Mar 19, 2022.
    11 changes: 11 additions & 0 deletions fix-omnisharp-asdf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/sh -v
    # 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)