C
C#3w ago
j0rund

✅ Can't run my code in Visual studios

So basically i'm a complete begginer when it comes to coding and i'm currently trying to use visual studios. Yet, when i try to run my code using f5 nothing happens. When i try to run it using the green button that's supposed to make it run all that pops up is a window that shows a bunch of my files. The window is titled "attach to process" so i'm guessing that i have to attach a process to my project however i have no idea how to do that or what a process even is. So, how do i make my code run? This might not be the right place to ask about visual studios but i didn't know where else to go. Thank u in advance.
36 Replies
ero
ero3w ago
screenshot of your vs
j0rund
j0rundOP3w ago
No description
ero
ero3w ago
You don't have a project in your solution You only have a single, separate file open
j0rund
j0rundOP3w ago
idk if this is how it's supposed to be fixed but when i click add -> existing project -> the project that i want to add, this shows up
j0rund
j0rundOP3w ago
No description
OlujA
OlujA3w ago
Right click solution(tab on the right) > add > new project > console app should look like this
No description
j0rund
j0rundOP3w ago
this happens when i try to create a new project according to ur instructions
No description
OlujA
OlujA3w ago
Can you open up terminal and paste this (visual studio>View tab>terminal)
dotnet --list-sdks
dotnet --list-sdks
OlujA
OlujA3w ago
No description
OlujA
OlujA3w ago
it should respond like this
No description
j0rund
j0rundOP3w ago
doesn't seem to respond at all
No description
OlujA
OlujA3w ago
-okay you are lacking .net SDK, you need to install it. close down visual studio. -download link https://dotnet.microsoft.com/en-us/download -after installation, open visual studio installer and look up to .NET desktop development is checked, if not check it (if you want to develop web apps, check that box too) -apply/install/download idk what the button is in english -then open up your solution again and try to list SDKs again
Microsoft
Download .NET (Linux, macOS, and Windows) | .NET
Free downloads for building and running .NET apps on Linux, macOS, and Windows. Runtimes, SDKs, and developer packs for .NET Framework, .NET, and ASP.NET.
MODiX
MODiX3w 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
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
i have now downloaded it and .net is checked but nothinf has changed
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
No description
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
when i clicked on the link i installed the 9.0 version
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
No description
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX3w 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
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
for some reason i can't screenshot it but this is what it says: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows PS C:\WINDOWS\system32> iex "& { $(irm https://gist.githubusercontent.com/tebeco/5c6cc0eee8c28fad3523008d58f83914/raw/d14890f540ae74ad72d950c48f6a242e9401d31e/fix-dotnet-path.ps1) }" ** If you're seing this message your SYS PATH is improperly set ** Your Old PATH was: C:\Program Files\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\dotnet;C:\Program Files\dotnet;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%SYSTEMROOT%\System32\OpenSSH\ ** Your New PATH will be: C:\Program Files\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet;C:\Program Files\dotnet;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%SYSTEMROOT%\System32\OpenSSH\ Press enter to continue (Ctrl+C to ABORT)
Installing PowerShell on Windows - PowerShell
Information about installing PowerShell on Windows
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
one second
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
i pressed enter and this is what showed up: ** PS C:\WINDOWS\system32> (with more "stars")
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
j0rund
j0rundOP3w ago
ok
j0rund
j0rundOP3w ago
No description
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX3w ago
If you have no further questions, please use /close to mark the forum thread as answered
j0rund
j0rundOP3w ago
it's working, tysm!
OlujA
OlujA3w ago
oh i see, another program/software installed x86 before before he installed visual studio

Did you find this page helpful?