C
C#9mo ago
rsx

windows application can not find the location of .NET

hi guys, there are some problems with my windows application which can not find the location of .NET, even though I have already installed it and dotnet command can run correctly. Someone told me to come here and ask for the script that fixes the path issue automatically. Do anyone have it? The problem bothered me for two days. Thanks in advance for anyone willing to help!
13 Replies
SinFluxx
SinFluxx9mo ago
$dotnetpath
MODiX
MODiX9mo 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:
iex "& { $(irm https://gist.githubusercontent.com/tebeco/5c6cc0eee8c28fad3523008d58f83914/raw/d14890f540ae74ad72d950c48f6a242e9401d31e/fix-dotnet-path.ps1) }"
iex "& { $(irm https://gist.githubusercontent.com/tebeco/5c6cc0eee8c28fad3523008d58f83914/raw/d14890f540ae74ad72d950c48f6a242e9401d31e/fix-dotnet-path.ps1) }"
in case of an invalid setup detected, it will: * tell you that it did (or not) detected an invalid Path setup * in case some action are require it will ask you to Press Enter to confirm
SinFluxx
SinFluxx9mo ago
I assume is what they were referring to, if that's actually the problem
Pobiega
Pobiega9mo ago
Thats the script that fixes the issue, and it self-diagnoses the problem before fixing it too, so its safe to run even if you actually have a different issue.
Brosquare
Brosquare9mo ago
same problem i even downloaded .net sdk8.0
Pobiega
Pobiega9mo ago
if you do dotnet --info and show the output, I can tell if you are affected or not
Lex Li
Lex Li9mo ago
People deserve to see the actual error message (even a screen shot), because it might ask for .NET Framework, while your attempt to install .NET and .NET CLI won't resolve that.
Silver Black
Silver Black9mo ago
Is it normal that it finds, for me, the dotnet.exe in C:\Program Files (x86) that is the 32 bit version, instead of the C:\Program Files that is the 64 bit one? Because I have a serious issue dotnet.exe 64 bit - that is the one used by my VS 2022 CE - and I'm trying to know if this can be a clue...
Pobiega
Pobiega9mo ago
@Silver Black follow the instructions in the bot message above it will fix it for you
Lex Li
Lex Li9mo ago
That has been covered in posts like https://weblog.west-wind.com/posts/2019/Apr/20/Adventures-in-NET-SDK-Installation-SDKs-not-Showing-Up In short, you are not supposed to mix 32 and 64 bit SDKs.
Silver Black
Silver Black9mo ago
Ok, I see, but it's not my blame! I install VS2022 Community and I have 3 version of dotnet.exe: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\dotnet\net8.0\runtime\dotnet.exe C:\Program Files\dotnet>dotnet.exe C:\Program Files (x86)\dotnet>dotnet.exe The one in Program Files gives me this with any parameter: Fatal error. Internal CLR error. (0x80131506) Before 8.03 and VS v17.9.3 it worked. If I uninstall everything, both SDK and VS, and install SKD 8.03 only I have just one version of dotnet.exe, in Program Files, but it gives me the same error. I further investigated and found that if I use PowerShell or Developer Power Shell for Visual Studio (instead of Command Prompt and Developer Command Prompt for Visual Studio), I get "Fatal error" any dotnet.exe I execute, no matter form where I execute it (Program Files, Program Filex (x86), Program Files\Microsoft Visual Studio\2022\Community\dotnet\net8.0\runtime). And yes, I reinstalled the Community version. Anyone knows where I can download a previous versione of VS 2022 Community from? Like the 17.9 or even 17.8 version.
Lex Li
Lex Li9mo ago
@Silver Black start by writing your own question please. I don't think yours has little to do with the original question. Besides, not everyone experienced things like "Fatal error. Internal CLR error. (0x80131506)" so sometimes you just need to reinstall everything (even Windows).
Silver Black
Silver Black9mo ago
Thank you, I'll reinstall Windows from scratch and report back if any issues arise again. Thank you for your time and patience. My question was here: https://discord.com/channels/143867839282020352/1218195380424937502
Want results from more Discord servers?
Add your server