C
C#2w 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
Angius2w 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_Teo2w 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
Angius2w 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_Teo2w ago
No description
Angius
Angius2w ago
In the terminal
Angius
Angius2w ago
No description
Gio_Teo
Gio_Teo2w ago
No description
Angius
Angius2w ago
dotnet --list-sdks
Gio_Teo
Gio_Teo2w ago
looking on chrome downloads it is 8.0.302
Angius
Angius2w ago
Execute the command I told you to execute And tell me what you got back
Gio_Teo
Gio_Teo2w ago
it does nothing
Angius
Angius2w ago
Show me that nothing
Gio_Teo
Gio_Teo2w ago
wait wrong image
Gio_Teo
Gio_Teo2w ago
No description
Angius
Angius2w ago
Okay dotnet --info
Gio_Teo
Gio_Teo2w ago
No description
Angius
Angius2w 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
Angius2w ago
Assuming of course you are on a 64-bit system
Gio_Teo
Gio_Teo2w ago
yes
Angius
Angius2w ago
Good
Gio_Teo
Gio_Teo2w ago
it's installing again thanks for helping me btw
Angius
Angius2w ago
No problem
Gio_Teo
Gio_Teo2w ago
I can't do anything because I already have it installed
No description
Angius
Angius2w ago
Huh, aight
Gio_Teo
Gio_Teo2w ago
there is only "restore, uninstall or close"
Angius
Angius2w ago
Close the installer ig It could be a path issue... $dotnetpath
MODiX
MODiX2w 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
Angius2w ago
Try this
Gio_Teo
Gio_Teo2w ago
ok "iex" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. C:\Windows\System32>
Angius
Angius2w ago
Did you use Powershell, or cmd?
Gio_Teo
Gio_Teo2w ago
It says that "iex" is not recognised as an inter/external program wai
Angius
Angius2w ago
You need specifically Poweshell for it to work
Gio_Teo
Gio_Teo2w 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
Angius2w ago
Weird, iex is a Powershell command...
Gio_Teo
Gio_Teo2w ago
do you have any idea of the why?
Angius
Angius2w ago
Not really Just to make sure, you closed the current cmd window, searched for Powershell, and ran that?
Gio_Teo
Gio_Teo2w ago
cmd was still open I did it again now and it's the same
Angius
Angius2w 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_Teo2w ago
Now i gtg, I will download it later, thanks really much for the help, I'll let you know later or tomorrow
Angius
Angius2w ago
Sure
Want results from more Discord servers?
Add your server
More Posts
How to handle outputs that alter the same line and remove lines while running a process?Hello, I am trying to run a process in a C# program and the process output alters on the same line. Application closing without any errors when uploading a pictureHey guy's i've been getting this error lately which is kind of weird tbh i've made an input to uploaHiding Encryption key from REHi, I made an application in C#, most of the strings are encrypted with AES and are in C++ DLL. what URL should Kestrel listen to in a docker container on Azure App ServiceI have an ASP.NET Core in a docker container that will be hosted on Azure App Service. What URL shouASP.Net WebForm application is becoming slower after precompiling it in AzureHello everyone, Recently we deployed a precompiled ASP.Net Webform application in Azure App ServiceNeed help with video processingI wanna display a video in opentk. Anyone know how to do that?Help with coding a JSON file-based framework for extending features in a Unity modIn my current project I want other modders to be able to add their own features via JSON files in a Making my functions more genericright now i have several functions that do essentially the same thing, the only difference being theHow to update app automatically ?I don't understand how to use "ClickOnce" or another method to update my c# winform app pls give me✅ The value '(image path)' is not valid for Image.Hey guys i'm new to Web development in general So basically i made an input for image file for a p