Coder Social home page Coder Social logo

emersonsoares / asdf-dotnet-core Goto Github PK

View Code? Open in Web Editor NEW
98.0 0.0 18.0 31 KB

✨ .Net Core plugin for asdf version manager

Home Page: https://github.com/asdf-vm/asdf

License: MIT License

Shell 100.00%
asdf asdf-plugin version-manager dotnet-core

asdf-dotnet-core's Introduction

🚧 asdf-dotnet-core

Build Status

.Net Core plugin for asdf version manager

Install

asdf plugin-add dotnet-core https://github.com/emersonsoares/asdf-dotnet-core.git

Use

Check asdf readme for instructions on how to install & manage versions of .Net Core.

DOTNET_ROOT

To set DOTNET_ROOT in your shell's initialization add the following:

. ~/.asdf/plugins/dotnet-core/set-dotnet-home.bash

For zsh shell, instead use:

. ~/.asdf/plugins/dotnet-core/set-dotnet-home.zsh

For fish shell, instead use:

. ~/.asdf/plugins/dotnet-core/set-dotnet-home.fish

asdf-dotnet-core's People

Contributors

emersonsoares avatar gpad avatar guang1234567 avatar hmnd avatar melkio avatar tobivogel avatar vraravam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asdf-dotnet-core's Issues

macOS Catalina (v 10.15.7) : terminal can't recognise dotnet command

Hi,

I have a fresh install of macOS and installed asdf. I made the setup of asdf and dotnet-core but the terminal command can't find dotnet command. I also ran the script that was on readme file of this project.

Do you have a hint of what should I do to fix it ?

Here are some results of my terminal:

XXXX@XXXXX-MacBook-Pro ~ % asdf list-all dotnet-core
1.1.14
1.1.14
2.1.202
2.2.207
2.1.810
3.0.103
3.1.402
5.0.100-rc.1.20452.10
XXXX@XXXXX-MacBook-Pro ~ % asdf list
dotnet-core
3.1.402
python
2.7.18
3.6.12
XXXX@XXXXX-MacBook-Pro ~ % asdf global dotnet-core 3.1.402
XXXX@XXXXX-MacBook-Pro ~ % dotnet
zsh: command not found: dotnet

How to have multiple SDKs/Runtimes at the same time ?

Hello.

I was trying to compile identity server ( https://github.com/DuendeSoftware/IdentityServer ) but it requires both SDK 5.0 and 3.1.0 to be available, I installed them both with asdf and set 5.0 as the global one but I am getting the following error

bash build.sh 
Tool 'signclient' (version '1.2.17') was restored. Available commands: SignClient
Tool 'dotnet-ef' (version '3.1.0') was restored. Available commands: dotnet-ef

Restore was successful.
~/Documents/Repositories/IdentityServer/src/Storage ~/Documents/Repositories/IdentityServer
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
  - The following frameworks were found:
      5.0.0 at [/home/kedare/.asdf/installs/dotnet-core/5.0.100/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=linuxmint.20-x6

A few info:

dotnet --list-sdks
5.0.100 [/home/kedare/.asdf/installs/dotnet-core/5.0.100/sdk]

dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.0 [/home/kedare/.asdf/installs/dotnet-core/5.0.100/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0 [/home/kedare/.asdf/installs/dotnet-core/5.0.100/shared/Microsoft.NETCore.App]

asdf list dotnet-core
  3.1.404
  5.0.100

How can I fix that ?

Thanks

DOTNET_ROOT and GitLab CI

I am using asdf and dotnet-core with GitLab Runner and am having issues with the set-dotnet-home.bash script. I have added it to the .bashrc file of the Docker image being used to run my CI jobs but when I print the environment variables I don't see DOTNET_ROOT set and all dotnet tools fail to run. However, I have the same line in my local .bashrc and it is working as expected. Has anyone run into something similar or have I stumbled across something that needs to be investigated further with a possible pull request to the script?

Rider can't detect dotnet sdk

even though the path is set to ~/.asdf/shims/dotnet, Rider says it cannot find the dotnet sdk. I don't know if this is something that others have encountered and if its even an asdf-dotnet-core issue

tail -r is present only on BSD (OSX)

I have create a PR #12 to fix this issue because tail -r is not present on unix/Linux systems only on BSD. So I have fixed using tac if tail -r is not present

DOTNET_ROOT in README

In README

. ~/.asdf/plugins/dotnet/set-dotnet-home.zsh

should be

. ~/.asdf/plugins/dotnet-core/set-dotnet-home.zsh

(dotnet-core is the correct directory after plugins and not dotnet)

set-dotnet-home.bash doesn't work

executing this script in bash:

. ~/.asdf/plugins/dotnet-core/set-dotnet-home.bash

I get this error:

$ . ~/.asdf/plugins/dotnet-core/set-dotnet-home.bash
bash: PROMPT_COMMAND: line 2: syntax error near unexpected token `;'
bash: PROMPT_COMMAND: line 2: `bash_prompt; ; prompt_command'

What do you think?

Fail to install

I am trying to install dotnet core 2.2 on Linux Mint 18.3 and I am running into an install issue.

$ asdf install dotnet-core 2.2
Downloading the CLI installer
Installing the CLI requested version 2.2. Please wait, installation may take a few minutes.
dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/2.2/dotnet-sdk-2.2-linux-x64.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
dotnet-install: Cannot download: https://dotnetcli.azureedge.net/dotnet/Sdk/2.2/dotnet-sdk-2.2-linux-x64.tar.gz
dotnet_install: Error: Could not download .NET Core SDK version 2.2
The CLI has been installed.

Even after it fails, it still appears as if it installs correctly and gets added to the adsf dotnet-core plugin as a "valid" version. I tried installing dotnet version 2.1 and 3.0 and ran into the same install error.

Maybe the site which we are trying to download the tar.gz file from has moved?

zsh + vscode needs an extra variable

To get the OmniSharp (from C# extension) on vscode to run I've also needed to set export MSBuildSDKsPath=~/.asdf/installs/dotnet-core/3.1.409/sdk/3.1.409/Sdks would be nice to have this on set-dotnet-home.zsh.

My bash skills does not allow me to open an issue on the matter 😞

Does not include SDK

This seems to only include the runtime, not the SDK. After installing and attempting to run dotnet --info I get No such command in 2.2 of dotnet-core The version management here is far less helpful in a dev environment if the sdk is not included. Although, I do see the sdk files in the install, so I'm not sure why the commands aren't accessible.

Error installing 8.0.201

Running asdf install dotnet-core latest produces a "Could not find .NET Core SDK with version = 8.0.201" error.

❯ asdf install dotnet-core latest
Downloading the CLI installer
Installing the CLI requested version 8.0.201. Please wait, installation may take a few minutes.
dotnet_install: Warning: Value "Current" is deprecated for -Channel option. Use "STS" instead.
dotnet-install: Attempting to download using primary link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.201/dotnet-sdk-8.0.201-osx-arm64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.201/dotnet-sdk-8.0.201-osx-arm64.tar.gz' is not available.
dotnet-install: Attempting to download using legacy link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.201/dotnet-dev-osx-arm64.8.0.201.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at legacy link 'https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.201/dotnet-dev-osx-arm64.8.0.201.tar.gz' is not available.
dotnet-install: Attempting to download using primary link https://dotnetbuilds.azureedge.net/public/Sdk/8.0.201/dotnet-sdk-8.0.201-osx-arm64.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at primary link 'https://dotnetbuilds.azureedge.net/public/Sdk/8.0.201/dotnet-sdk-8.0.201-osx-arm64.tar.gz' is not available.
dotnet-install: Attempting to download using legacy link https://dotnetbuilds.azureedge.net/public/Sdk/8.0.201/dotnet-dev-osx-arm64.8.0.201.tar.gz
curl: (22) The requested URL returned error: 404
dotnet-install: The resource at legacy link 'https://dotnetbuilds.azureedge.net/public/Sdk/8.0.201/dotnet-dev-osx-arm64.8.0.201.tar.gz' is not available.
dotnet_install: Error: Could not find `.NET Core SDK` with version = 8.0.201
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
The CLI has been installed.

The install fails, leaving an invalid dotnet shim

Fail to install

The asdf install dotnet-core 3.0.0 is not working. It seems Microsoft has changed the download links.

I've tried a workaround changing the download URL in bin/install

# From
https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh
# To
https://dotnetwebsite.azurewebsites.net/download/dotnet-core/scripts/v1/dotnet-install.sh

As it seems to have been changed as we can see here, but it doesn't work too.

Here is my terminal output:

$ asdf install dotnet-core 3.0.0
Downloading the CLI installer
Installing the CLI requested version 3.0.0. Please wait, installation may take a few minutes.
/home/rafael/.asdf/installs/dotnet-core/3.0.0/dotnet-install.sh: line 147: VERSION_ID: unbound variable
/home/rafael/.asdf/installs/dotnet-core/3.0.0/dotnet-install.sh: line 205: VERSION_ID: unbound variable
dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/3.0.0/dotnet-sdk-3.0.0-linux-x64.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
dotnet-install: Cannot download: https://dotnetcli.azureedge.net/dotnet/Sdk/3.0.0/dotnet-sdk-3.0.0-linux-x64.tar.gz
dotnet_install: Error: Could not find/download: `.NET Core SDK` with version = 3.0.0
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
The CLI has been installed.

Can't install dotnet 2.2.6

  1. list-all does not list all versions

  2. Can't install unlisted versions (like 2.2.6 as the dotnet-install.sh is probably out of date.

Can't use multiple global versions

Hi,

I'm using Fedora 31 and trying to use multiple global versions of dotnet-core with no lucky.

Command:
asdf global dotnet-core 3.1.101 2.2.207

And then when runing this command:
dotnet --info

I've got:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.101
 Commit:    b377529961

Runtime Environment:
 OS Name:     fedora
 OS Version:  31
 OS Platform: Linux
 RID:         fedora.31-x64
 Base Path:   /home/eric/.asdf/installs/dotnet-core/3.1.101/sdk/3.1.101/

Host (useful for support):
  Version: 3.1.1
  Commit:  a1388f194c

.NET Core SDKs installed:
  3.1.101 [/home/eric/.asdf/installs/dotnet-core/3.1.101/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.1 [/home/eric/.asdf/installs/dotnet-core/3.1.101/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.1 [/home/eric/.asdf/installs/dotnet-core/3.1.101/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
[eric@localhost ~]$ asdf global dotnet-core 3.1.101 2.2.207
[eric@localhost ~]$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.101
 Commit:    b377529961

Runtime Environment:
 OS Name:     fedora
 OS Version:  31
 OS Platform: Linux
 RID:         fedora.31-x64
 Base Path:   /home/eric/.asdf/installs/dotnet-core/3.1.101/sdk/3.1.101/

Host (useful for support):
  Version: 3.1.1
  Commit:  a1388f194c

.NET Core SDKs installed:
  3.1.101 [/home/eric/.asdf/installs/dotnet-core/3.1.101/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.1 [/home/eric/.asdf/installs/dotnet-core/3.1.101/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.1 [/home/eric/.asdf/installs/dotnet-core/3.1.101/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Am I missing something or is this not possible to achieve?

Plugin/curl is not downloading the dotnet install script due to a 302 redirect not being handled

The plugin seems to not be downloading the dotnet install script due to a redirect

https://github.com/emersonsoares/asdf-dotnet-core/blob/master/bin/install#L5

Uses curl -s which ends up at a redirect at Microsoft

>
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
} [5 bytes data]
< HTTP/2 302
< cache-control: no-store
< location: /download/dotnet/scripts/v1/dotnet-install.sh
< x-cache: TCP_MISS
< server: Kestrel
< request-context: appId=cid-v1:109cec76-ff6c-4be0-97b5-4f02dbac2451
< x-powered-by: ASP.NET
< x-content-type-options: nosniff
< x-azure-ref: 0VIUvYAAAAAC5fC83hO+LQoZB5vEay5PcTE9OMjFFREdFMDIxNQBlMWRmMDcwYS1hZTQ0LTRjMGItYTU0Yi1jNDkzODA0ZTRkOWY=
< date: Fri, 19 Feb 2021 09:30:59 GMT
< content-length: 0
<
{ [0 bytes data]
* Connection #0 to host dotnet.microsoft.com left intact

Curl reports success code, result is en empty string piped to the file.

We then try to run that file, which as it is empty, results in nothing happening.

Proposed fix

Add -L to the curl command

# curl -v -s -L https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh > dotnet-curled.sh
...
{ [16160 bytes data]
* Connection #0 to host dotnet.microsoft.com left intact

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.