C
C#Erik

❔ c# DOTNET error

Can you help me? what should I do
No description
Angius
Angius212d ago
Is your system 64-bit or 32-bit?
Pobiega
Pobiega212d ago
it seems likely you installed the wrong SDK version, but yeah, what OS are you using?
YAI1 (nnaaaa)
YAI1 (nnaaaa)212d ago
I can see the win 11 logo or smth.. uh
Pobiega
Pobiega212d 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
YAI1 (nnaaaa)
YAI1 (nnaaaa)212d ago
it trying to target x86 with a x64 dev kit, I'm confused
Pobiega
Pobiega212d ago
thats not how I interpret that message I think you have the x86 SDK installed, and devkit requires x64
Angius
Angius212d ago
Uh, are you the OP to begin with...?
YAI1 (nnaaaa)
YAI1 (nnaaaa)212d ago
nay
Pobiega
Pobiega212d ago
lol
Angius
Angius212d ago
We await The Silent One, then
Pobiega
Pobiega212d ago
@Erik wake up
Erik
Erik212d ago
64 64
Angius
Angius212d 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
Erik212d ago
No description
Erik
Erik212d ago
yes
Pobiega
Pobiega212d ago
open a terminal/command prompt and type dotnet --info please
Erik
Erik212d ago
yesss I installed it but it didn't work
Pobiega
Pobiega212d ago
listen dotnet --info in a terminal fooocusss
Angius
Angius212d ago
And he went to sleep again
Erik
Erik212d ago
No description
Pobiega
Pobiega212d 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
Erik212d ago
64 okeyeyy
Erik
Erik212d ago
No description
Pobiega
Pobiega212d ago
No description
Erik
Erik212d ago
soryyy
Erik
Erik212d ago
No description
Pobiega
Pobiega212d ago
okay, open that dotnet folder is there a dotnet.exe there?
Erik
Erik212d ago
Yes there is
Erik
Erik212d ago
No description
Pobiega
Pobiega212d 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
Erik212d ago
let's do
Pobiega
Pobiega212d ago
search for "environment variables" on the windows start panel
Pobiega
Pobiega212d ago
should look like this
No description
Pobiega
Pobiega212d ago
but in your language do not send friend requests
Erik
Erik212d ago
soryy
Erik
Erik212d ago
No description
Erik
Erik212d ago
yesss
Pobiega
Pobiega212d ago
yes that big button in the bottom right click that
Pobiega
Pobiega212d ago
No description
Erik
Erik212d ago
yes
Pobiega
Pobiega212d ago
then find the blue line in the bottom list the one called "Path" click the middle button ("edit")
Erik
Erik212d ago
No description
Pobiega
Pobiega212d ago
yep, thats the one
Erik
Erik212d ago
yes
Pobiega
Pobiega212d ago
show me the new screen
Erik
Erik212d ago
No description
Pobiega
Pobiega212d ago
perfect see that bottom one? click that, then click "Yukari Tasi"
Erik
Erik212d ago
yes
Pobiega
Pobiega212d ago
we want to move it up one step so its above the x86 one
Erik
Erik212d ago
No description
Pobiega
Pobiega212d ago
okay that was.. overkill :p but sure
Erik
Erik212d ago
soryyy
Pobiega
Pobiega212d ago
it just needs to be above the x86 dotnet one so move it down beneatht eh "system32" ones
Erik
Erik212d ago
okkeyyy
Pobiega
Pobiega212d ago
just to be safe
Erik
Erik212d ago
No description
Pobiega
Pobiega212d ago
perfect now press "ok" until all the system windows are closed
Erik
Erik212d ago
ookkeyy
Pobiega
Pobiega212d ago
then, close down VS and all open terminals
Erik
Erik212d ago
To close Does the computer need to be restarted?
Pobiega
Pobiega212d 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
Erik212d ago
No description
Pobiega
Pobiega212d ago
there we go it worked
Erik
Erik212d ago
WOOOWWWW THANKYOUUUUU THANK YOU VERY MUCH
Pobiega
Pobiega212d ago
yw
Angius
Angius212d ago
We should make the solution into a tag lol
Pobiega
Pobiega212d ago
there is a tag for it $dotnetpath
MODiX
MODiX212d 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
Pobiega212d ago
but its scary 😄 also, its straight up replaces the x86 installation instead of shifting them around and requires admin mode powershell etc
Accord
Accord211d 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
More Posts
❔ Datacontext WPF?How to DataContext From 2 xaml to 1 ViewModel without calling ViewModel twice?❔ Can you help me with this exercies please.https://pastebin.com/Gtyrj4Sk this is the code, i dont know how to get the last element from queue a❔ beginner helpI need help on where to start.❔ Form ProblemThis is likely a very beginner mistake, but I have no idea how to resolve it. If I need to provide t✅ Unity: Issue with the Box Collider 2D and Layers.Hi. I need help with some collider situation I have. In words: It seems like the layer of the collid✅ Attempting to create a method throws CS0116?Brothers, everything was working fine on the previous projects I started. Now for some reason I am g❔ razor pages List custom classIs it possible to pass data of a List<custom class type > from one page to another? With the optioKeyIn my code im trying to get it to take only 1 input then it wont take another input until the key pr❔ ✅ :white_check_mark: Trying to have a program read a word in a string and add to a counterI have to make a program that reads the different letters, consonants and some words as repeated thr❔ ✅ "Cannot convert from int to string" why cant I take away these values??the code underlined in red gives me this message, why doesnt the subtraction work?Overloading "+" operatorI am adding fractions together and need to overload the plus operator, but I keep running into an er❔ ✅ StaticWhat does static do in classes? I need demos❔ Convert regex match groups into parametersSo I have a program that is checking for common errors in a log, it uses regex to capture them, then❔ WinUi TitleBarHey, How do I make my app look like this? The titlebar colors.❔ VScode doesn't recognize C# filesWhy is VScode not recognizing C# files even after installing C# extensions? please help me❔ It....it doesn't make any sense. Weird errors.Here is the code https://paste.mod.gg/lcypwrfenlsz/0 If I remove the else if in the next line, it g✅ Help me with my C# homework please......It's easy but I'm trying to do it for 3 hours with no results❔ So i'm learning how to transition from one level to another and I got this error.Would anyone know how to fix this? ```cs using System.Collections; using System.Collections.Genericclasseswhen i call GetPiece() function it returns null everytime and im not sure why❔ => operatorSo I read while looking into LINQ documentation that `=>` is the syntax for a lambda expression. Now