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

NativeCommandExitException: Program "dotnet.exe" ended with non-zero exit code: -2147450751. #131

Closed
corto31810 opened this issue Apr 29, 2024 · 5 comments
Labels
area-tutorials Issues related to getting started tutorials needs-more-info Not enough information has been provided. Please share more detail as requested. tutorial-console Console tutorial related issues

Comments

@corto31810
Copy link

URL

https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/install

Operating system

windows

More information about your system

windows 11 X64

Description

error in terminal :NativeCommandExitException: Program "dotnet.exe" ended with non-zero exit code: -2147450751.

dotnet --info

No response

@corto31810 corto31810 added the area-tutorials Issues related to getting started tutorials label Apr 29, 2024
@mairaw
Copy link
Contributor

mairaw commented May 2, 2024

When did you get that command? Was it when you typed dotnet in the terminal?

What happens if you open a command prompt window outside of VS Code and type dotnet? Do you still get an error? Have you tried restarting VS Code?

@mairaw mairaw added needs-more-info Not enough information has been provided. Please share more detail as requested. tutorial-console Console tutorial related issues labels May 2, 2024
@corto31810
Copy link
Author

hi,
I get the message in the vs code terminal:

PS C:\Users\philippe> dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.

path-to-application:
The path to an application .dll file to execute.
NativeCommandExitException: Program "dotnet.exe" ended with non-zero exit code: -2147450751.

and in powershell :

PS C:\Users\philippe> dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.

path-to-application:
The path to an application .dll file to execute.
PS C:\Users\philippe>

I restarted vs code and I still got the same error

if I run the dotnet --info command in cs code terminal, I get this:

PS C:\Users\philippe> dotnet --info
SDK .NET :
Version: 8.0.204
Commit: c338c7548c
Workload version: 8.0.200-manifests.9f663350

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.204\

Charges de travail .NET installées :
Il n'y a aucune charge de travail installée à afficher.

Host:
Version: 8.0.4
Architecture: x64
Commit: 2d7eea2529

.NET SDKs installed:
3.1.425 [C:\Program Files\dotnet\sdk]
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
5.0.416 [C:\Program Files\dotnet\sdk]
8.0.204 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

@mairaw
Copy link
Contributor

mairaw commented May 3, 2024

Can you type where.exe dotnet in PowerShell and see what you get? Wondering if it's anything related to the PATH.

If x86 is returned first, I'd try the instructions described at dotnet/core#5962 (comment).

@corto31810
Copy link
Author

when I typed the command
"where.exe dotnet", powershell replied that it did not know the command, I updated the powershell and since then I have no more problems.
thanks a lot for your help

@mairaw
Copy link
Contributor

mairaw commented May 7, 2024

Great to hear!

@mairaw mairaw closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-tutorials Issues related to getting started tutorials needs-more-info Not enough information has been provided. Please share more detail as requested. tutorial-console Console tutorial related issues
Projects
None yet
Development

No branches or pull requests

2 participants