C
C#ā€¢9mo ago
JaufreyTheShark

āœ… Microsoft Visual Studio Issue?

Hello o/! I'm starting my journey on learning C# and decided to start with a tutorial my friend recommended to me, but after having gone through the beginning section a few times im not sure what I've done wrong exactly. The person is able to run the code via a green play button that has the name of the file attached to it, but my green button only says attach, and when I click on it it brings up tasks from my task manager, what am I meant to do exactly so I can run code and have a console in general?
45 Replies
Thinker
Thinkerā€¢9mo ago
Looks like you didn't create a project
Pobiega
Pobiegaā€¢9mo ago
C# is project based, not file/directory based so you need to create/open a project
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
So I went ahead and made a project, and made sure it opened and everything and I believe I'm loaded into it, but I still only have this attach button, ctrl+shift+n, clicked on console app, ranamed the proj to 'ExampleProj' (pic related), select .net 6, then create and make it, and even tried loading into it through file. I'm sorry if i'm just being a dodo brain ;w;
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
Pobiega
Pobiegaā€¢9mo ago
creating the project should open it as well but if it doesnt, make sure you open it by loading the .sln or .csproj files
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
I have
Pobiega
Pobiegaā€¢9mo ago
well, can you screenshot the top of your VS window again?
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
Pobiega
Pobiegaā€¢9mo ago
I can see in the ones you sent before it says "miscellaneous files" and that means you didnt load a project ah I see the error can you close VS entirely and open a command prompt /terminal /powershell window?
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
yup
Pobiega
Pobiegaā€¢9mo ago
then type dotnet --info and show me the results
Buddy
Buddyā€¢9mo ago
You need to install .NET Desktop Development module
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
Pobiega
Pobiegaā€¢9mo ago
I got this @Networking is a pain save me pls , its x86 vs x64 issues
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
seperately from the visual studio one? cause I had clicked that on when I downloaded it
Pobiega
Pobiegaā€¢9mo ago
no, dont worry I'll help so see how it says "architecture: x86" and "other architectures found: x64"?
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
yes
Pobiega
Pobiegaā€¢9mo ago
we need to swap that around we want to be in x64, since thats where your SDK is installed and also, who uses 32 bits anyways šŸ˜„ so, we need to edit our system environemnt variables. do you know how to do that?
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
not in the slightest jojosweat
Pobiega
Pobiegaā€¢9mo ago
thats fine! press your windows key and type "environment variables" idk what locale you are using for windows, so you might need to translate it yourself
Pobiega
Pobiegaā€¢9mo ago
Pobiega
Pobiegaā€¢9mo ago
this is what it looks like for me
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
I have edit the system envrionment variables
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
and this itty bitty window popped up
Pobiega
Pobiegaā€¢9mo ago
thats what we want click the env vars button at the bottom
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
alright
Pobiega
Pobiegaā€¢9mo ago
in the bottom list, find "Path" click "edit" you should get another list of paths there are two we care about: c:\program files(x86)\dotnet and c:\program files\dotnet tell me when you've found them
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
found them both
Pobiega
Pobiegaā€¢9mo ago
okay, use the "move up " button on c:\program files\dotnet until its ABOVE the other one
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
done
Pobiega
Pobiegaā€¢9mo ago
yep! now click "ok" "ok" "ok" "ok" until all windows are closed šŸ˜„ then, close any and all terminal windows and open a new one do dotnet --info again
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
Pobiega
Pobiegaā€¢9mo ago
Pobiega
Pobiegaā€¢9mo ago
yeah buddy!
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
dance
Pobiega
Pobiegaā€¢9mo ago
ok, launch visual studio and create a new project I should keep a counter for how many people I've guided through this process šŸ˜„ Its really silly that the VS installer can't detect an existing x86 runtime and warn people
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
It worked cheer was surprised the course didnt have anything about this in the Q&A, didnt have much luck googling the issue either laughingdog
Pobiega
Pobiegaā€¢9mo ago
the issue was that your computer already had the x86 runtime installed if you didn't, this would have worked fine. if you had the x64 runtime, it would have worked fine
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
well, thank you so much for the help bow
Pobiega
Pobiegaā€¢9mo ago
np feel free to tell people about this, if anyone else in your course/class has issues šŸ™‚
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
ah im solo learning, just picked up some classes of udemy
Pobiega
Pobiegaā€¢9mo ago
ah okay best of luck
JaufreyTheShark
JaufreyTheSharkā€¢9mo ago
thank you templarthumbsup
Pobiega
Pobiegaā€¢9mo ago
if you feel done here, you can $close the thread
MODiX
MODiXā€¢9mo ago
Use the /close command to mark a forum thread as answered