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
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'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?
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?In the terminal
dotnet --list-sdks
looking on chrome downloads it is 8.0.302
Execute the command I told you to execute
And tell me what you got back
it does nothing
Show me that nothing
wait
wrong image
Okay
dotnet --info
Seems no SDK is installed. Try to install it again, from here: https://dotnet.microsoft.com/en-us/download/dotnet/8.0
Assuming of course you are on a 64-bit system
yes
Good
it's installing again
thanks for helping me btw
No problem
I can't do anything because I already have it installed
Huh, aight
there is only "restore, uninstall or close"
Close the installer ig
It could be a path issue...
$dotnetpath
* 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:
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
Try this
ok
"iex" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.
C:\Windows\System32>
Did you use Powershell, or cmd?
It says that "iex" is not recognised as an inter/external program
wai
You need specifically Poweshell for it to work
"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
Weird,
iex
is a Powershell command...do you have any idea of the why?
Not really
Just to make sure, you closed the current cmd window, searched for Powershell, and ran that?
cmd was still open
I did it again now
and it's the same
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 haveNow i gtg, I will download it later, thanks really much for the help, I'll let you know later or tomorrow
Sure