Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing extension seems to expect .NET tools, and fails #287

Closed
elihorne opened this issue Jun 21, 2021 · 6 comments · Fixed by #291
Closed

Installing extension seems to expect .NET tools, and fails #287

elihorne opened this issue Jun 21, 2021 · 6 comments · Fixed by #291

Comments

@elihorne
Copy link

First time user of the extension. I mostly work with JS (node and front end). When installing the extension, I get the following error message from VS Code (see screenshot). Uninstalling the Stripe extension and re-installing provides the same result.

"An error occurred while installing .NET (5.0): .NET acquisition failed: Installation failed: Error: Command failed..."

CleanShot 2021-06-21 at 16 43 35@2x

Perhaps user error, but for my level of usage, requiring .NET tooling feels like heavy overhead, and I'm disinclined to continue since other extensions don't seem to have required this.

@gracegoo-stripe
Copy link
Contributor

Hey Eli, apologies you ran into this on your first install and thank you for reporting this. Your assumption is correct, the ideal scenario is that we only require .NET tooling if we detect that you are working on a .NET project. There are two things I'll need to look into here:

  1. Why the extension tries to acquire a .NET runtime when you're working on a node project. Under the hood, we have some logic that starts up a .NET language server if we detect a .sln or .csproj file, can you verify that the project you had open did not have files with these extension in your workspace?
  2. Why the dotnet acquisition failed -- Looks like you are on macOS, but could you confirm?

At this moment, I don't think the failure to acquire the runtime should be so loud either so I'll look into that as well.

Lastly, you should still be able to get all of the features the extension has to offer if you're developing on node, so clicking on the "Don't show again" button should let you proceed. Please let me know if that is not the case and if you run into any other issues!

@elihorne
Copy link
Author

Thanks for the fast reply!

I can confirm that the project context I was in uses Node for development and serving a variety of front end frameworks (Vue, etc) and that I'm on MacOS - Latest version, Apple M1 chip. No .NET development happening anywhere on my machine, to my knowledge.

I'll click "don't show again" and see what happens.

@gracegoo-stripe
Copy link
Contributor

gracegoo-stripe commented Jun 21, 2021

I tested this out on a bigger repo I work on and noticed that it caught a sln file in my node_modules folder! So I will update our solution finding logic to make sure that does not happen anymore.

I tried to reproduce the .NET runtime download failure but was unable to do so. The .NET Runtime Tool extension uses this script to install: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script. Reading through the sh file, that error gets thrown if the script gets a 404 when it tries to access the download link, which it should have gotten from https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json.

I did notice that the extension logs to its own output channel though, so if you are able to find those please let us know! I'm hoping it'll tell us where it exactly tried to download from. You can find the logs by going to View -> Output -> .NET Runtime (in the dropdown).

Screen Shot 2021-06-21 at 4 14 47 PM

@elihorne
Copy link
Author

Downloading the .NET Runtime.
Downloading .NET version(s) 5.0.7 .... Error!
Failed to download .NET 5.0.7:
Command failed: "/Users/elihorne/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.1.0/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/elihorne/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/5.0.7" -Version 5.0.7 -Runtime dotnet
dotnet_install: Error: Could not find `.NET Core Runtime` with version = 5.0.7
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support


 Error!
.NET Acquisition Failed: Installation failed: Error: Command failed: "/Users/elihorne/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.1.0/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/elihorne/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/5.0.7" -Version 5.0.7 -Runtime dotnet
dotnet_install: Error: Could not find `.NET Core Runtime` with version = 5.0.7
dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support

gracegoo-stripe added a commit that referenced this issue Jun 21, 2021
Addresses part of #287
We want to exclude common folders that are not part of the user's workspace when we try to detect solutions.
gracegoo-stripe added a commit that referenced this issue Jun 21, 2021
Addresses part of #287
We want to exclude common folders that are not part of the user's workspace when we try to detect solutions.
gracegoo-stripe added a commit that referenced this issue Jun 22, 2021
Addresses part of #287
We want to exclude common folders that are not part of the user's workspace when we try to detect solutions.
@gracegoo-stripe
Copy link
Contributor

Thanks for the logs! They aren't as helpful as I'd hoped so I'll keep on digging. I thought we could also swallow and log the error if there is an error during the .NET runtime installation but the window is created from within the dependent extension so I don't think this will be something we can do at the moment.

Meanwhile, I have a new release out with the fix (2.0.2) to the project detection so you shouldn't even be hitting that path anymore.

@gracegoo-stripe
Copy link
Contributor

The acquisition issue is related to: dotnet/vscode-dotnet-runtime#201.
Dotnet < 6.0 is not supported for native M1, and there are plans to make older versions compatible with Rossetta 2 (an emulator): dotnet/core#4879 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants