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

Installation error #8347

Closed
26mmangan opened this issue Apr 3, 2023 · 52 comments
Closed

Installation error #8347

26mmangan opened this issue Apr 3, 2023 · 52 comments
Labels
area-setup Issues related to installing .NET Core area-tutorials Issues related to getting started tutorials needs-more-info Not enough information has been provided. Please share more detail as requested.

Comments

@26mmangan
Copy link

Problem encountered on https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/create
Operating System: windows

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.
image

@26mmangan
Copy link
Author

26mmangan commented Apr 3, 2023

I installed it, and repaired it twice. Still doesnt work
image
image

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

Hi @26mmangan! I'm sorry to hear you're running into problems.

This might be an issue with PATH.

Check the output of the where.exe dotnet command and if your system is x64 and the x86 path returns first, please follow the steps at #5962 (comment) to fix the issue.

Let us know how that goes.

@mairaw mairaw added needs-more-info Not enough information has been provided. Please share more detail as requested. area-tutorials Issues related to getting started tutorials area-setup Issues related to installing .NET Core labels Apr 3, 2023
@26mmangan
Copy link
Author

26mmangan commented Apr 3, 2023

Ive reinstalled it a few times,
image
Doesn't look like it's working
image

@richlander
Copy link
Member

Looks like you are in the user space. You want the system one. You appear to be looking at the first box. You want the second one.

image

@26mmangan
Copy link
Author

image

@richlander
Copy link
Member

Can you show your system path?

Also, show the results of this:

C:\Users\rich>where dotnet
C:\Program Files\dotnet\dotnet.exe
C:\Users\rich>dotnet --version
8.0.100-preview.1.23115.2

@26mmangan
Copy link
Author

image

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

Can you open the one I highlighted below?

image

@26mmangan
Copy link
Author

image

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

The x86 is listed first there. Can you confirm what kind of machine you have?

Type system type on your windows toolbar and open the System Information app.
If System Type is x64, then you need to move down the x86 entry to be the last one.

@26mmangan
Copy link
Author

I have a x64 machine. Will do.

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

Let us know if after the change, you can type dotnet commands. Make sure to open a new window.

@26mmangan
Copy link
Author

image
image

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

what where dotnet returns now? and did you make sure you opened a new window after you applied the changes to path?

@26mmangan
Copy link
Author

image
Yes, I used a new window

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

but x86 is still showing up as first, so maybe the changes weren't saved, Can you double check the environment variables again?

@26mmangan
Copy link
Author

image
🤷‍♂️

@mairaw
Copy link
Contributor

mairaw commented Apr 3, 2023

Usually that step by step works 😢 @richlander any other suggestions?

@richlander
Copy link
Member

Make sure to close the command prompt after changing the values in the environment variables.

@26mmangan
Copy link
Author

I did, I restarted it twice

@richlander
Copy link
Member

You can just delete the x86 one. It isn't useful.

Also, it is dotnet --version not --ver

@26mmangan
Copy link
Author

Done, alright thanks

@26mmangan
Copy link
Author

image
image

@richlander
Copy link
Member

And type where dotnet again to see where that is coming from.

@26mmangan
Copy link
Author

image

@richlander
Copy link
Member

That is very odd. Something is clearly injecting the x86 path. Which .NET versions do you have installed?

Like this:

image

@26mmangan
Copy link
Author

image

@richlander
Copy link
Member

Can you double check that the x86 is not present in both the System and User PATH Environment variables?

I have no idea what is causing this. It is very odd.

@26mmangan
Copy link
Author

image
image

@richlander
Copy link
Member

That looks correct.

Can you show the output of set from your command prompt? It's really only the PATH variable I'm interested in.

@26mmangan
Copy link
Author

26mmangan commented Apr 4, 2023

image
image

@richlander
Copy link
Member

That looks right.

Please show me where dotnet now and dotnet --info

@26mmangan
Copy link
Author

image

@richlander
Copy link
Member

This is the problem. You have an old 5.0 install on your machine that you need to remove.

Perhaps this was installed by Visual Studio. If you have that, can you go into the Visual Studio Installer and remove it from the installed components?

@26mmangan
Copy link
Author

How do I do this?

@mairaw
Copy link
Contributor

mairaw commented Apr 4, 2023

But the set path above is showing x86 first @richlander. Is that expected?

@26mmangan
Copy link
Author

image
This is my extensions list for VS Code if you need it.

@mairaw
Copy link
Contributor

mairaw commented Apr 4, 2023

This is VS Code. Do you have Visual Studio also installed?

@26mmangan
Copy link
Author

26mmangan commented Apr 4, 2023

Naw, just VS Code
image

@26mmangan
Copy link
Author

@mairaw @richlander

@NikolaMilosavljevic
Copy link
Member

NikolaMilosavljevic commented Apr 4, 2023

@26mmangan it appears that you have x86 versions of .NET 5.0 WindowsDesktop runtime, which also carries NETCore runtime.

The easiest way to remove would be from Control Panel or Settings app, but if they don't show there, here's the alternative.

  1. Download the following installer: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-5.0.10-windows-x86-installer

  2. Run the installer. You should get a dialog that says Modify Setup, with multiple options, one being Uninstall - proceed with that. In some rare cases, it's possible that you would see a regular dialog for first-time installation - you would proceed to install the product. After that, you'd run the installer again and choose Uninstall.

After .NET 5 is uninstalled, open a new command prompt and try the commands that were failing, or producing unexpected results, previously, i.e. dotnet --version and dotnet --info.

@26mmangan
Copy link
Author

26mmangan commented Apr 5, 2023

Successfully uninstalled, and reinstalled, same issue.
image

@richlander
Copy link
Member

You re-installed .NET 5? Is there a reason for that? Also, you seem to have 5.0.10. Is there a reason you are using that version? If you need .NET 5, can you install 5.0.17? https://dotnet.microsoft.com/en-us/download/dotnet/5.0

@26mmangan
Copy link
Author

26mmangan commented Apr 5, 2023

No, I re installed .NET 6.0.407
image
image
I'm not sure why .NET 5.0 is on my computer, I haven't installed anything other than the above

@richlander
Copy link
Member

You still have 5.0 installed. Did you try running the 5.0 installer and choosing uninstall?

@26mmangan
Copy link
Author

Done.
image
image
image

@NikolaMilosavljevic
Copy link
Member

@26mmangan can you share the outputs of dotnet --info and set PATH commands?

@26mmangan
Copy link
Author

image
image

@NikolaMilosavljevic
Copy link
Member

Thanks - it is odd. I understand that you installed and uninstalled 5.0.408 SDK, but have you tried to install (or repair) x86 version of 5.0.10 WindowsDesktop installer, and then run the same installer to uninstall it? I've shared the steps 2 days ago: #8347 (comment)

It would be good to go through those steps and see if there is any improvement in dotnet --info and dotnet --version results.

I presume you are starting a new command window after each of these install/uninstall operations, as that is necessary to get the updated values of environment variables, like PATH.

@26mmangan
Copy link
Author

Oops, I installed and uninstalled 5.0.4... Here:
image
image
It works! I think...

@NikolaMilosavljevic
Copy link
Member

NikolaMilosavljevic commented Apr 6, 2023

That's great news!

@richlander
Copy link
Member

This looks resolved. Sorry that this was so hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-setup Issues related to installing .NET Core area-tutorials Issues related to getting started tutorials needs-more-info Not enough information has been provided. Please share more detail as requested.
Projects
None yet
Development

No branches or pull requests

4 participants