C
C#14mo ago
Erik

❔ c# DOTNET error

Can you help me? what should I do
No description
71 Replies
Angius
Angius14mo ago
Is your system 64-bit or 32-bit?
Pobiega
Pobiega14mo ago
it seems likely you installed the wrong SDK version, but yeah, what OS are you using?
nnaaaa
nnaaaa14mo ago
I can see the win 11 logo or smth.. uh
Pobiega
Pobiega14mo ago
ok, so you have windows 11, thats a 64 bit OS you should use the 64 bit SDK lets confirm, so open a terminal and type dotnet --info
nnaaaa
nnaaaa14mo ago
it trying to target x86 with a x64 dev kit, I'm confused
Pobiega
Pobiega14mo ago
thats not how I interpret that message I think you have the x86 SDK installed, and devkit requires x64
Angius
Angius14mo ago
Uh, are you the OP to begin with...?
nnaaaa
nnaaaa14mo ago
nay
Pobiega
Pobiega14mo ago
lol
Angius
Angius14mo ago
We await The Silent One, then
Pobiega
Pobiega14mo ago
@Erik wake up
Erik
ErikOP14mo ago
64 64
Angius
Angius14mo ago
Oh heyyy, you're awake, nice! Did you install the 63-bit SDK or the 32-bit one? dotnet --list-sdks will tell you
Erik
ErikOP14mo ago
No description
Erik
ErikOP14mo ago
yes
Pobiega
Pobiega14mo ago
open a terminal/command prompt and type dotnet --info please
Erik
ErikOP14mo ago
yesss I installed it but it didn't work
Pobiega
Pobiega14mo ago
listen dotnet --info in a terminal fooocusss
Angius
Angius14mo ago
And he went to sleep again
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
x86 host, no SDKs installed, no other architectures found okay, lets check if its the infamous TeBe bug open up a file explorer and go to C:\Program Files\ NOT (x86) check if there is a dotnet folder there
Erik
ErikOP14mo ago
64 okeyeyy
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
No description
Erik
ErikOP14mo ago
soryyy
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
okay, open that dotnet folder is there a dotnet.exe there?
Erik
ErikOP14mo ago
Yes there is
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
okay, then its a confirmed case of the TeBe because you have both dotnet hosts installed (x86 AND x64) and the x86 was installed first, its "blocking" the correct one from running due to PATH priority so we're gonna adjust that path priority we need to edit your system environment variables
Erik
ErikOP14mo ago
let's do
Pobiega
Pobiega14mo ago
search for "environment variables" on the windows start panel
Pobiega
Pobiega14mo ago
should look like this
No description
Pobiega
Pobiega14mo ago
but in your language do not send friend requests
Erik
ErikOP14mo ago
soryy
Erik
ErikOP14mo ago
No description
Erik
ErikOP14mo ago
yesss
Pobiega
Pobiega14mo ago
yes that big button in the bottom right click that
Pobiega
Pobiega14mo ago
No description
Erik
ErikOP14mo ago
yes
Pobiega
Pobiega14mo ago
then find the blue line in the bottom list the one called "Path" click the middle button ("edit")
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
yep, thats the one
Erik
ErikOP14mo ago
yes
Pobiega
Pobiega14mo ago
show me the new screen
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
perfect see that bottom one? click that, then click "Yukari Tasi"
Erik
ErikOP14mo ago
yes
Pobiega
Pobiega14mo ago
we want to move it up one step so its above the x86 one
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
okay that was.. overkill :p but sure
Erik
ErikOP14mo ago
soryyy
Pobiega
Pobiega14mo ago
it just needs to be above the x86 dotnet one so move it down beneatht eh "system32" ones
Erik
ErikOP14mo ago
okkeyyy
Pobiega
Pobiega14mo ago
just to be safe
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
perfect now press "ok" until all the system windows are closed
Erik
ErikOP14mo ago
ookkeyy
Pobiega
Pobiega14mo ago
then, close down VS and all open terminals
Erik
ErikOP14mo ago
To close Does the computer need to be restarted?
Pobiega
Pobiega14mo ago
no just shut down VS and all open terminal windows when thats done, start a new terminal window and type dotnet --info again
Erik
ErikOP14mo ago
No description
Pobiega
Pobiega14mo ago
there we go it worked
Erik
ErikOP14mo ago
WOOOWWWW THANKYOUUUUU THANK YOU VERY MUCH
Pobiega
Pobiega14mo ago
yw
Angius
Angius14mo ago
We should make the solution into a tag lol
Pobiega
Pobiega14mo ago
there is a tag for it $dotnetpath
MODiX
MODiX14mo ago
* Open powershell in a terminal in admin mode as in the following video: https://cdn.discordapp.com/attachments/569261465463160900/1157744344183341156/20230930-1822-10.7436061.mp4 * copy/paste the following script * it will tell you if it detects invalid Path setup * Press Enter to confirm
$OldSysPath=[System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine); `
$Hasx86=($OldSysPath.Split(';') | ? { $_.StartsWith('C:\Program Files (x86)\dotnet')}).Count -gt 0; `
if ($Hasx86) {
Write-Host "**********************************************************************"; `
Write-Host "If you're seing this message your SYS PATH is improperly set" -ForegroundColor Yellow; `
$NewSystemPath=$OldSysPath.Replace('C:\Program Files (x86)\dotnet', 'C:\Program Files\dotnet'); `
Write-Host "**********************************************************************"; `
Write-Host "Your Old PATH was:" -ForegroundColor Green; `
Write-Host "$($OldSysPath)"; `
Write-Host "**********************************************************************"; `
Write-Host "Your New PATH will be:" -ForegroundColor Green; `
Write-Host "$($NewSystemPath)"; `
Write-Host "Press enter to continue (Ctrl+C to ABORT)" -ForegroundColor Red -NoNewLine; Read-Host; `
Write-Host "**********************************************************************"; `
[System.Environment]::SetEnvironmentVariable('PATH', $NewSystemPath, [System.EnvironmentVariableTarget]::Machine) `
}
$OldSysPath=[System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine); `
$Hasx86=($OldSysPath.Split(';') | ? { $_.StartsWith('C:\Program Files (x86)\dotnet')}).Count -gt 0; `
if ($Hasx86) {
Write-Host "**********************************************************************"; `
Write-Host "If you're seing this message your SYS PATH is improperly set" -ForegroundColor Yellow; `
$NewSystemPath=$OldSysPath.Replace('C:\Program Files (x86)\dotnet', 'C:\Program Files\dotnet'); `
Write-Host "**********************************************************************"; `
Write-Host "Your Old PATH was:" -ForegroundColor Green; `
Write-Host "$($OldSysPath)"; `
Write-Host "**********************************************************************"; `
Write-Host "Your New PATH will be:" -ForegroundColor Green; `
Write-Host "$($NewSystemPath)"; `
Write-Host "Press enter to continue (Ctrl+C to ABORT)" -ForegroundColor Red -NoNewLine; Read-Host; `
Write-Host "**********************************************************************"; `
[System.Environment]::SetEnvironmentVariable('PATH', $NewSystemPath, [System.EnvironmentVariableTarget]::Machine) `
}
Pobiega
Pobiega14mo ago
but its scary 😄 also, its straight up replaces the x86 installation instead of shifting them around and requires admin mode powershell etc
Accord
Accord14mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server