C
C#ā€¢15mo 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ā€¢15mo ago
Looks like you didn't create a project
Pobiega
Pobiegaā€¢15mo ago
C# is project based, not file/directory based so you need to create/open a project
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
Pobiega
Pobiegaā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
I have
Pobiega
Pobiegaā€¢15mo ago
well, can you screenshot the top of your VS window again?
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
Pobiega
Pobiegaā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
yup
Pobiega
Pobiegaā€¢15mo ago
then type dotnet --info and show me the results
Buddy
Buddyā€¢15mo ago
You need to install .NET Desktop Development module
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
Pobiega
Pobiegaā€¢15mo ago
I got this @Networking is a pain save me pls , its x86 vs x64 issues
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
seperately from the visual studio one? cause I had clicked that on when I downloaded it
Pobiega
Pobiegaā€¢15mo ago
no, dont worry I'll help so see how it says "architecture: x86" and "other architectures found: x64"?
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
yes
Pobiega
Pobiegaā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
not in the slightest jojosweat
Pobiega
Pobiegaā€¢15mo 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ā€¢15mo ago
Pobiega
Pobiegaā€¢15mo ago
this is what it looks like for me
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
I have edit the system envrionment variables
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
and this itty bitty window popped up
Pobiega
Pobiegaā€¢15mo ago
thats what we want click the env vars button at the bottom
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
alright
Pobiega
Pobiegaā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
found them both
Pobiega
Pobiegaā€¢15mo ago
okay, use the "move up " button on c:\program files\dotnet until its ABOVE the other one
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
done
Pobiega
Pobiegaā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
Pobiega
Pobiegaā€¢15mo ago
Pobiega
Pobiegaā€¢15mo ago
yeah buddy!
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
dance
Pobiega
Pobiegaā€¢15mo 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
JaufreyTheSharkOPā€¢15mo 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ā€¢15mo 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
JaufreyTheSharkOPā€¢15mo ago
well, thank you so much for the help bow
Pobiega
Pobiegaā€¢15mo ago
np feel free to tell people about this, if anyone else in your course/class has issues šŸ™‚
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
ah im solo learning, just picked up some classes of udemy
Pobiega
Pobiegaā€¢15mo ago
ah okay best of luck
JaufreyTheShark
JaufreyTheSharkOPā€¢15mo ago
thank you templarthumbsup
Pobiega
Pobiegaā€¢15mo ago
if you feel done here, you can $close the thread
MODiX
MODiXā€¢15mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server