ā 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
Looks like you didn't create a project
C# is project based, not file/directory based
so you need to create/open a project
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;
creating the project should open it as well
but if it doesnt, make sure you open it by loading the
.sln
or .csproj
filesI have
well, can you screenshot the top of your VS window again?
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?
yup
then type
dotnet --info
and show me the resultsYou need to install .NET Desktop Development module
I got this @Networking is a pain save me pls , its x86 vs x64 issues
seperately from the visual studio one? cause I had clicked that on when I downloaded it
no, dont worry
I'll help
so see how it says "architecture: x86" and "other architectures found: x64"?
yes
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?
not in the slightest
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
this is what it looks like for me
I have edit the system envrionment variables
and this itty bitty window popped up
thats what we want
click the env vars button at the bottom
alright
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 themfound them both
okay, use the "move up " button on
c:\program files\dotnet
until its ABOVE the other onedone
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
againyeah buddy!
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
It worked was surprised the course didnt have anything about this in the Q&A, didnt have much luck googling the issue either
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
well, thank you so much for the help
np
feel free to tell people about this, if anyone else in your course/class has issues
š
ah im solo learning, just picked up some classes of udemy
ah okay
best of luck
thank you
if you feel done here, you can $close the thread
Use the /close command to mark a forum thread as answered