C
C#6mo ago
Gio_Teo

Visual Studio Code

Hi everyone. I have a question. I have installed on my PC visual studio code and I wanted to write a C# file. I downloaded C# and C# Dev kit extension and .NET Install Tool. Now, why when I go to "new file" there is only a python or a text file that I can create? And when I try to create a new .NET file it says: "The .NET Core SDK cannot be located: Error running dotnet --info: It was not possible to find any installed .NET Core SDKs Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from: https://aka.ms/dotnet-download . .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path." but I installed it correctly and I also verified it using "where.exe dotnet". Someone know how to make it work?
40 Replies
Angius
Angius6mo ago
Did you install the sdk or the runtime? Also, creating a .cs file is not how you do it. C# is project-based, you need to create one such project with dotnet new template'
Gio_Teo
Gio_TeoOP6mo ago
I went to the website he gave me to install it (https://dot.net/core-sdk-vscode) and I downloaded it. After that I installed it on the PC the SDK, what is the runtime?
Angius
Angius6mo ago
What you got from there should be fine And runtime just allows you to run programs in .net, not make them What does, say, dotnet --version show?
Gio_Teo
Gio_TeoOP6mo ago
No description
Angius
Angius6mo ago
In the terminal
Angius
Angius6mo ago
No description
Gio_Teo
Gio_TeoOP6mo ago
No description
Angius
Angius6mo ago
dotnet --list-sdks
Gio_Teo
Gio_TeoOP6mo ago
looking on chrome downloads it is 8.0.302
Angius
Angius6mo ago
Execute the command I told you to execute And tell me what you got back
Gio_Teo
Gio_TeoOP6mo ago
it does nothing
Angius
Angius6mo ago
Show me that nothing
Gio_Teo
Gio_TeoOP6mo ago
wait wrong image
Gio_Teo
Gio_TeoOP6mo ago
No description
Angius
Angius6mo ago
Okay dotnet --info
Gio_Teo
Gio_TeoOP6mo ago
No description
Angius
Angius6mo ago
Seems no SDK is installed. Try to install it again, from here: https://dotnet.microsoft.com/en-us/download/dotnet/8.0
No description
Angius
Angius6mo ago
Assuming of course you are on a 64-bit system
Gio_Teo
Gio_TeoOP6mo ago
yes
Angius
Angius6mo ago
Good
Gio_Teo
Gio_TeoOP6mo ago
it's installing again thanks for helping me btw
Angius
Angius6mo ago
No problem
Gio_Teo
Gio_TeoOP6mo ago
I can't do anything because I already have it installed
No description
Angius
Angius6mo ago
Huh, aight
Gio_Teo
Gio_TeoOP6mo ago
there is only "restore, uninstall or close"
Angius
Angius6mo ago
Close the installer ig It could be a path issue... $dotnetpath
MODiX
MODiX6mo 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
Angius
Angius6mo ago
Try this
Gio_Teo
Gio_TeoOP6mo ago
ok "iex" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. C:\Windows\System32>
Angius
Angius6mo ago
Did you use Powershell, or cmd?
Gio_Teo
Gio_TeoOP6mo ago
It says that "iex" is not recognised as an inter/external program wai
Angius
Angius6mo ago
You need specifically Poweshell for it to work
Gio_Teo
Gio_TeoOP6mo ago
"iex" non è riconosciuto come comando interno o esterno, >> un programma eseguibile o un file batch. In riga:1 car:7 + "iex" non è riconosciuto come comando interno o esterno, + ~ Token 'non' imprevisto nell'espressione o nell'istruzione. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnexpectedToken PS C:\WINDOWS\system32> PS C:\WINDOWS\system32> C:\Windows\System32> C:\Windows\System32> : Termine 'C:\Windows\System32>' non riconosciuto come nome di cmdlet, funzione, programma eseguibile o file script. Controllare l'ortografia del nome o verificare che il percorso sia incluso e corretto, quindi riprovare. In riga:1 car:1 + C:\Windows\System32> + ~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Windows\System32>:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\WINDOWS\system32> PS C:\WINDOWS\system32> it says the same thing
Angius
Angius6mo ago
Weird, iex is a Powershell command...
Gio_Teo
Gio_TeoOP6mo ago
do you have any idea of the why?
Angius
Angius6mo ago
Not really Just to make sure, you closed the current cmd window, searched for Powershell, and ran that?
Gio_Teo
Gio_TeoOP6mo ago
cmd was still open I did it again now and it's the same
Angius
Angius6mo ago
Huh I guess we could try installing the new version of Powershell... https://learn.microsoft.com/en-gb/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4 Installing it should be as simple as winget install --id Microsoft.Powershell --source winget from the current Pwsh you have
Gio_Teo
Gio_TeoOP6mo ago
Now i gtg, I will download it later, thanks really much for the help, I'll let you know later or tomorrow
Angius
Angius6mo ago
Sure
Want results from more Discord servers?
Add your server