C
C#10mo ago
John Stewart

✅ Can't get VSCode to run a C# Project

Hello, In my upcoming class, I need to set up my Development environment, which includes a .NET 6.0 Framework as seen here (https://byui-cse.github.io/cse210-ww-course/unit01/dev-environment/) However, no matter what I do, I cannot get the program to run. I've installed both the .NET 6.0 and 8.0 SDKs and Runtimes I've reinstalled the VSCode Extensions multiple times (including the experimental versions) I manually went through all the files and changed 6.0 to 8.0 However, the following error appears, even after changing the dotnet path to the x64 installation location: The command could not be loaded, possibly because: * You intended to execute a .NET application: The application 'restore' does not exist. * You intended to execute a .NET SDK command: No .NET SDKs were found. Download a .NET SDK: https://aka.ms/dotnet/download Learn about SDK resolution: https://aka.ms/dotnet/sdk-not-found What am I doing wrong?
Microsoft
.NET Downloads (Linux, macOS, and Windows)
Official .NET downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of applications.
Select which .NET version to use - .NET
Learn how .NET automatically finds and chooses runtime versions for your program. Additionally, this article teaches you how to force a specific version.
13 Replies
Pobiega
Pobiega10mo ago
can you do dotnet --info in a terminal and show the full output here please?
John Stewart
John StewartOP10mo ago
Host: Version: 7.0.14 Architecture: x86 Commit: 808851b07a .NET SDKs installed: No SDKs were found. .NET runtimes installed: Microsoft.AspNetCore.App 7.0.14 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.14 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x64 [C:\Program Files\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
dotnet command - .NET CLI
Learn about the dotnet command (the generic driver for the .NET CLI) and its usage.
Microsoft
.NET Downloads (Linux, macOS, and Windows)
Official .NET downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of applications.
Pobiega
Pobiega10mo ago
okidoki, easy fix $dotnetpath
MODiX
MODiX10mo 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
Pobiega
Pobiega10mo ago
you have the x32 AND the x64 dotnets installed and your x32 is "blocking" the x64 this script re-arranges the path so the x64 takes prescedent
John Stewart
John StewartOP10mo ago
That was surprisingly fast.
Pobiega
Pobiega10mo ago
you are not the first, and wont be the last 🙂
John Stewart
John StewartOP10mo ago
I bugged my University's IT staff, Instructor for the Upcoming class, and finally the program authors before coming here (I'll have to tell the authors sorry for bothering them in the morning)
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Pobiega
Pobiega10mo ago
ye
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius10mo ago
$ dotnet --fix-path
the command dotnet was not found because paths are borked
$ dotnet --fix-path
the command dotnet was not found because paths are borked
:when:
John Stewart
John StewartOP10mo ago
Muchas Thank-You's
Want results from more Discord servers?
Add your server