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

Failed to download .NET 8.0.10~x64~aspnetcore when it said it was Done? #2012

Open
o-o00o-o opened this issue Nov 8, 2024 · 19 comments
Open
Assignees

Comments

@o-o00o-o
Copy link

o-o00o-o commented Nov 8, 2024

Describe the bug.

Get error "Error aquiring .NET!" on vscode start

Log from .NET Install Tool is fairly unhelpful

ms-azuretools.vscode-azure-github-copilot requested to download the .NET ASP.NET Runtime.
Downloading .NET version(s) 8.0.10~x64~aspnetcore ........... Done!
.NET 8.0.10~x64~aspnetcore executable path: c:\Users\bgerhardi\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore\dotnet.exe


Error : (DotnetInstallationValidationError)
Failed to download .NET 8.0.10~x64~aspnetcore:
Validation of .dotnet installation for version {"installId":"8.0.10~x64~aspnetcore","version":"8.0.10","architecture":"x64","isGlobal":false,"installMode":"aspnetcore"} failed: Expected installation folder c:\Users\bgerhardi\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore does not exist.


Error : (DotnetCommandFailed)
Failed to download .NET 8.0.10~x64~aspnetcore:
.NET Acquisition Failed: Validation of .dotnet installation for version {"installId":"8.0.10~x64~aspnetcore","version":"8.0.10","architecture":"x64","isGlobal":false,"installMode":"aspnetcore"} failed: Expected installation folder c:\Users\bgerhardi\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore does not exist., Error: Validation of .dotnet installation for version {"installId":"8.0.10~x64~aspnetcore","version":"8.0.10","architecture":"x64","isGlobal":false,"installMode":"aspnetcore"} failed: Expected installation folder c:\Users\bgerhardi\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore does not exist.
    at c.assertOrThrowError (c:\Users\bgerhardi\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:38:19)
    at c.validateDotnetInstall (c:\Users\bgerhardi\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:18:18)
    at y.next (c:\Users\bgerhardi\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:251:43)
    at Generator.next (<anonymous>)
    at s (c:\Users\bgerhardi\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:5:58)

more detailed log attached

Please attach log file(s) here if you have any.

DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1731059151952.txt
The log file location should be copied to your clipboard if you came from VS Code.

Reproduction Steps

Open vscode, get error. It has been happeneing for several weeks. computer restart doesn't help

Expected Behavior

.net updated/installed successfully

Exceptions & Errors (if any)

No response

.NET Install Tool Version

8.0.10

Your operating system? Please provide more detail, such as the version and or distro above.

Windows

VS Code Version

1.95.2 (user setup)

@nagilson
Copy link
Member

nagilson commented Nov 11, 2024

Thank you for taking the time to write a detailed report.
Is it true that c:\Users\YOUR_USERNAME\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore\dotnet.exe does not exist? Of course replace your username.

Probably if you installed the .NET SDK (using our extension command to install .NET SDK 8.0.1xx) and restart vscode it would get rid of the error for you. Though not fix our bug 😄

--
@dotnet/install-scripts-maintainers

STDERR:  & : AuthorizationManager check failed.
At line:1 char:137
+ ... ]::Tls12; & 'c:\Users\user\.vscode\extensions\ms-dotnettools.vsc ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

If the install script hits this error, will it continue to work? Is this due to a lack of powershell policy? It should be greater than ConstrainedLanguage or NoLanguage which I thought is all that is necessary.

@hamfrysl
Copy link

Getting the same issue for about a week now.
Tried installing different versions of .NET, and even reverted to the last month version, did not work.
Please advise.

Thank you for taking the time to write a detailed report. Is it true that c:\Users\YOUR_USERNAME\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore\dotnet.exe does not exist? Of course replace your username.

Probably if you installed the .NET SDK (using our extension command to install .NET SDK 8.0.1xx) and restart vscode it would get rid of the error for you. Though not fix our bug 😄

-- @dotnet/install-scripts-maintainers

STDERR:  & : AuthorizationManager check failed.
At line:1 char:137
+ ... ]::Tls12; & 'c:\Users\user\.vscode\extensions\ms-dotnettools.vsc ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

If the install script hits this error, will it continue to work? Is this due to a lack of powershell policy? It should be greater than ConstrainedLanguage or NoLanguage which I thought is all that is necessary.

@JanProvaznik
Copy link
Member

JanProvaznik commented Nov 12, 2024

If the install script hits this error, will it continue to work?

Likely no.

Is this due to a lack of powershell policy?

Unlikely, this error can appear in various scenarios.

@nagilson
Copy link
Member

nagilson commented Nov 12, 2024

Getting the same issue for about a week now. Tried installing different versions of .NET, and even reverted to the last month version, did not work. Please advise.

Thank you for taking the time to write a detailed report. Is it true that c:\Users\YOUR_USERNAME\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.10~x64~aspnetcore\dotnet.exe does not exist? Of course replace your username.
Probably if you installed the .NET SDK (using our extension command to install .NET SDK 8.0.1xx) and restart vscode it would get rid of the error for you. Though not fix our bug 😄
-- @dotnet/install-scripts-maintainers

STDERR:  & : AuthorizationManager check failed.
At line:1 char:137
+ ... ]::Tls12; & 'c:\Users\user\.vscode\extensions\ms-dotnettools.vsc ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

If the install script hits this error, will it continue to work? Is this due to a lack of powershell policy? It should be greater than ConstrainedLanguage or NoLanguage which I thought is all that is necessary.

As a workaround, can you install the .NET 8 aspnetcore runtime or .NET 8 sdk, then follow the guidance in the https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime&ssr=false#overview:~:text=I%20already%20have%20a%20.NET%20Runtime%20or%20SDK%20installed%2C%20and%20I%20want%20to%20use%20it 'I already have a .NET Runtime or SDK installed, and I want to use it' section to set the setting to use it.

@nagilson
Copy link
Member

If the install script hits this error, will it continue to work?

Likely no.

Is this due to a lack of powershell policy?

Unlikely, this error can appear in various scenarios.

Thank you @JanProvaznik 😄 Do you have any further context into how this error occurs? Should we try to get more information from the user so we can see if this is a bug that can be resolved?

@nagilson nagilson self-assigned this Nov 12, 2024
@JanProvaznik
Copy link
Member

JanProvaznik commented Nov 12, 2024

Sorry, I don't have much insight. my answer was based on a few quick searches. What is the invocation of install scripts in this project? It would be nice to have a minimal reproduction.

@easystreetgames
Copy link

easystreetgames commented Nov 13, 2024

I started having this problem yesterday also. I am using VS Code with Unity. I have not made any changes. It started displaying this message repeatedly in the Output panel:
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.

Actually, I realized that I started using React yesterday with VS Code. Perhaps that setup made a change that is causing the problem. I used npx create-react-app my-app to set up the React app.

@sedat-eyuboglu
Copy link

I am getting same error in VS Code

Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.

@Kruille
Copy link

Kruille commented Nov 13, 2024

I believe they made a fatal error pointing the update to 8.0.10 when it is supposed to be 9.0.10.
That was the only way to fix the issue. Install sdk 9.0.10.
Or revert c# language installation and choose 8.0.483.

@sedat-eyuboglu
Copy link

sedat-eyuboglu commented Nov 14, 2024

I installed 8.0.10 by myself. The error message disappeared. Try to install underlined SDK version by yourself.
Additionally, i am on Windows 11

@JanProvaznik
Copy link
Member

Could you tell me your system locales Get-WinSystemLocale? I realized this might be related: dotnet/install-scripts#541

@sedat-eyuboglu
Copy link

Could you tell me your system locales Get-WinSystemLocale? I realized this might be related: dotnet/install-scripts#541

LCID Name DisplayName


1033 en-US English (United States)

@JanProvaznik
Copy link
Member

Not that then.

@easystreetgames
Copy link

I was also able to fix the problem by installing .NET 8.0.10 using this link: https://dotnet.microsoft.com/en-us/download/dotnet/8.0?form=MG0AV3. Make sure to select the 8.0.10 version before downloading. I am on Windows 11.

@MarkBennett
Copy link

I'm using the a devcontainer that builds our environment from the mcr.microsoft.com/devcontainers/dotnet:dev-8.0-bookworm image and am seeing this error as of updating the C# for Visual Studio Extension from Microsoft.

Here's my complete Dockerfile for reference:

# Dotnet 8.0 Dev Container
FROM mcr.microsoft.com/devcontainers/dotnet:dev-8.0-bookworm

# Install SQL Tools: SQLPackage and sqlcmd
COPY mssql/installSQLtools.sh installSQLtools.sh
RUN bash ./installSQLtools.sh \
     && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

USER vscode

# Setup Dotnet Dev Certs
RUN dotnet dev-certs https --trust

# Install Azure CLI
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

# Install Node Packages
RUN . /usr/local/share/nvm/nvm.sh \
     && nvm install 20 \
     && nvm use 20 \
     && npm install -g typescript azure-functions-core-tools@4 --unsafe-perm true

The C# extension is now failing to start with this output:

2024-11-14 16:46:41.674 [info] Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
2024-11-14 16:46:41.674 [info] No compatible .NET runtime found. Minimum required version is 8.0.10.
2024-11-14 16:46:45.657 [info] [Error - 4:46:45 PM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
2024-11-14 16:46:45.657 [info] Error: Could not resolve the dotnet path!
    at t.DotnetRuntimeExtensionResolver.<anonymous> (/home/vscode/.vscode-server/extensions/ms-dotnettools.csharp-2.55.28-linux-arm64/dist/extension.js:2:1142621)
    at Generator.next (<anonymous>)
    at s (/home/vscode/.vscode-server/extensions/ms-dotnettools.csharp-2.55.28-linux-arm64/dist/extension.js:2:1140600)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

@nagilson nagilson added P2 and removed P0 labels Nov 14, 2024
@nagilson
Copy link
Member

nagilson commented Nov 14, 2024

For all of the new people commenting, that was a bug in the C# extension. Please update the C# extension for a fix. See #2021

For the original comments, @JanProvaznik:
Heres the full command we called (in the string parts we had)

powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy unrestricted -Command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; & "c:\Users\user\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-2.2.2\dist\install scripts\dotnet-install.ps1" '-InstallDir', "c:\\Users\\user\\.vscode\\extensions\\ms-dotnettools.vscode-dotnet-runtime-2.2.2\\dist", '-Version', '8.0', '-Verbose', '-Runtime', 'aspnetcore'

I provided some additional info on our internal memo based on the log which contains stderr, stdout, signal, status of the call. The path string is parsed by our lib and the 8.0 should be fine, those are used normally everywhere and work. I dont think the inputs to the call are going to give much more insight, unfortunately, besides maybe the security protocol/exec policy

@bwateratmsft
Copy link
Collaborator

The GitHub Copilot for Azure extension has a user seeing a similar error message ("Expected executable does not exist at "/Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11arm64aspnetcore/dotnet""):

ms-azuretools.vscode-azure-github-copilot requested to download the .NET ASP.NET Runtime.
Downloading .NET version(s) 8.0.11~arm64~aspnetcore .... Done!
.NET 8.0.11~arm64~aspnetcore executable path: /Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11~arm64~aspnetcore/dotnet


Error : (DotnetInstallationValidationError)
Failed to download .NET 8.0.11~arm64~aspnetcore:
Validation of .dotnet installation for version {"installId":"8.0.11~arm64~aspnetcore","version":"8.0.11","architecture":"arm64","isGlobal":false,"installMode":"aspnetcore"} failed: Expected executable does not exist at "/Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11~arm64~aspnetcore/dotnet"


Error : (DotnetCommandFailed)
Failed to download .NET 8.0.11~arm64~aspnetcore:
.NET Acquisition Failed: Validation of .dotnet installation for version {"installId":"8.0.11~arm64~aspnetcore","version":"8.0.11","architecture":"arm64","isGlobal":false,"installMode":"aspnetcore"} failed: Expected executable does not exist at "/Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11~arm64~aspnetcore/dotnet", Error: Validation of .dotnet installation for version {"installId":"8.0.11~arm64~aspnetcore","version":"8.0.11","architecture":"arm64","isGlobal":false,"installMode":"aspnetcore"} failed: Expected executable does not exist at "/Users/username/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11~arm64~aspnetcore/dotnet"
	at c.assertOrThrowError (/Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.2.3/dist/extension.js:2:99774)
	at c.validateDotnetInstall (/Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.2.3/dist/extension.js:2:99368)
	at y.<anonymous> (/Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.2.3/dist/extension.js:2:39828)
	at Generator.next (<anonymous>)
	at s (/Users/username/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.2.3/dist/extension.js:2:33041)

@nagilson
Copy link
Member

nagilson commented Nov 19, 2024

Do they have a log they can provide? Please see above for an example, or, our create new issue template explains how to get our log.
@bwateratmsft

That is basically if everything looked fine but dotnet did not exist on the file system afterwards for some reason. Might be a different issue.

@pamelafox
Copy link

@nagilson I've filed an issue with my logs here:
#2059

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

No branches or pull requests

10 participants