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

Windows dotnet ps1 script doesn't install system wide in Program Files\dotnet #44409

Open
MCPtz opened this issue Jan 16, 2025 · 2 comments
Open
Assignees
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-fundamentals/svc install/subsvc 🗺️ reQUEST Triggers an issue to be imported into Quest.

Comments

@MCPtz
Copy link

MCPtz commented Jan 16, 2025

Type of issue

Other (describe below)

Description

The page has incorrect information about the install path for dotnet 8.

From this bug report, the ps1 installs to the local user only, e.g. C:\Users\username\AppData\Local\Microsoft\dotnet\dotnet.exe
dotnet/install-scripts#17
There is no option to install it for all users at Program Files\dotnet

But this documentation page describes the location as Program Files\dotnet
https://learn.microsoft.com/en-us/dotnet/core/install/windows#install-with-powershell

If we look under the section "No .NET SDK was found", it claims the PATH should be to Program Files\dotnet, but we won't find .NET8 there.

After I installed .NET8 using the above power shell script, it was installed to local user, rather than Program Files.

PS C:\Users\username> where.exe dotnet
C:\Users\username\AppData\Local\Microsoft\dotnet\dotnet.exe
C:\Program Files\dotnet\dotnet.exe
PS C:\Users\username> dotnet --info

Host:
  Version:      8.0.12
  Architecture: x64
  Commit:       89ef51c5d8
  RID:          win-x64

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.12 [C:\Users\username\AppData\Local\Microsoft\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.12 [C:\Users\username\AppData\Local\Microsoft\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.12 [C:\Users\username\AppData\Local\Microsoft\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
...

After above power shell install, it doesn't work in cmd.exe or cygwin.

So when I ran on cmd.exe, I don't get .NET8:

C:\Users\bamboo>dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.408
 Commit:    0c3669d367

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.408\

global.json file:
  Not found

Host:
  Version:      6.0.16
  Architecture: x64
  Commit:       1e620a42e7

.NET SDKs installed:
  5.0.408 [C:\Program Files\dotnet\sdk]
  5.0.411 [C:\Program Files\dotnet\sdk]
  6.0.408 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.28 [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 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.28 [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 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.28 [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 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Same on cygwin:

dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.408
 Commit:    0c3669d367

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.408\

Page URL

https://learn.microsoft.com/en-us/dotnet/core/install/windows

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/install/windows.md

Document Version Independent Id

d11d0d14-8a03-50e4-5c00-9a4417ad4d0a

Article author

@adegeo

Metadata

  • ID: 1eeab451-820f-de42-983e-4d0d5764f6ab
  • Service: dotnet-fundamentals
  • Sub-service: install

Related Issues

@dotnet-policy-service dotnet-policy-service bot added the ⌚ Not Triaged Not triaged label Jan 16, 2025
@adegeo adegeo self-assigned this Jan 17, 2025
@adegeo adegeo added doc-enhancement Improve the current content [org][type][category] 🗺️ reQUEST Triggers an issue to be imported into Quest. and removed ⌚ Not Triaged Not triaged labels Jan 17, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 17, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 17, 2025
@adegeo
Copy link
Contributor

adegeo commented Jan 17, 2025

Hello. To be clear, you're saying that the troubleshooting section talking about not being able to find dotnet should be enhanced to indicate that it might not always be "program files."

@MCPtz
Copy link
Author

MCPtz commented Jan 17, 2025

Under the troubleshooting section, it states it will be installed onto Program Files.

Under this section:
https://learn.microsoft.com/en-us/dotnet/core/install/windows#no-net-sdk-was-found

It's showing the script installs onto Program Files, when it actually installs onto the user's AppData.

Verify that you have both versions installed by running the where.exe dotnet command. If you do, you should see an entry for both the Program Files\ and Program Files (x86)\ folders. If the Program Files (x86)\ folder is first, as demonstrated by the following example, it's incorrect and you should continue on to the next step.

Adding it to the PATH should use the user's path:

C:\Users\username\AppData\Local\Microsoft\dotnet\dotnet.exe

But the bug in the summary shows it won't be installed there and it was decided that bug won't be fixed.

If it needs to be installed onto Program Files, they have to use the Windows Installer instead (AFAIK):
https://learn.microsoft.com/en-us/dotnet/core/install/windows#net-installer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-fundamentals/svc install/subsvc 🗺️ reQUEST Triggers an issue to be imported into Quest.
Projects
Development

No branches or pull requests

2 participants