C
C#2mo ago
Rook

✅ New to visual studio why are my Console.Write/ReadLines white?

Im trying to make a console app with .net
No description
64 Replies
333fred
333fred2mo ago
Did you open a project? Or just a random cs file?
Rook
Rook2mo ago
Project
333fred
333fred2mo ago
Can you take a screenshot of your solution explorer? And does your project build?
Rook
Rook2mo ago
No its doesnt build Well it builds just not the latest version
333fred
333fred2mo ago
That just means it doesn't build
Rook
Rook2mo ago
Where do i find solution explorer?
333fred
333fred2mo ago
Just take a screenshot of VS entirely
Rook
Rook2mo ago
No description
333fred
333fred2mo ago
Yeah, so see how it says "Miscellaneous Files" at the top-left there?
Rook
Rook2mo ago
yeah
333fred
333fred2mo ago
That means it's not actually the Program.cs file from your project
Rook
Rook2mo ago
so how do i use the program.cs
333fred
333fred2mo ago
Double-click on the Program.cs in your project (Note: the window on the right, titled "Solution Explorer", is your solution explorer)
Rook
Rook2mo ago
Nothing happens ohh right thank you
333fred
333fred2mo ago
Close the file and try again
Rook
Rook2mo ago
its still the same
333fred
333fred2mo ago
It still says misc files?
Rook
Rook2mo ago
yeah
333fred
333fred2mo ago
If you click the dropdown, do you see any other options?
Rook
Rook2mo ago
no
333fred
333fred2mo ago
Also, I just realized, you're using .NET Framework Did you intentionally choose that?
Rook
Rook2mo ago
I did but idk if i should be
333fred
333fred2mo ago
$newproject
MODiX
MODiX2mo ago
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework. .NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended. https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
333fred
333fred2mo ago
I would delete your current project and start over, this time using a modern .NET option
Rook
Rook2mo ago
This one?
No description
333fred
333fred2mo ago
Yes
Rook
Rook2mo ago
It says miscellanous files top left again
333fred
333fred2mo ago
Did you delete the old project? And not make the new project in the same location as the old project?
Rook
Rook2mo ago
Okay ive deleted them all this error comes up fater i make the project
Rook
Rook2mo ago
No description
333fred
333fred2mo ago
Uh, what happens if you open a comment prompt and run dotnet --list-sdks
Rook
Rook2mo ago
I cant even run it, it says attach
333fred
333fred2mo ago
huh?
Rook
Rook2mo ago
look
Rook
Rook2mo ago
idk if i did the prompt right but where start normally is. Theres attach
No description
333fred
333fred2mo ago
Nono Literally open a command prompt This isn't a vs thing
Rook
Rook2mo ago
ohh
Rook
Rook2mo ago
No description
333fred
333fred2mo ago
:squint: Alright, uh, something is broken in your install
Rook
Rook2mo ago
😔
333fred
333fred2mo ago
What I would do is something like: 1. Reboot. 2. Open the VS Installer and run a repair. Make sure that you've installed the .NET desktop development workload. See if you can access dotnet on the command line
Rook
Rook2mo ago
No description
333fred
333fred2mo ago
That last line was step 3, sorry
Rook
Rook2mo ago
No description
Rook
Rook2mo ago
i guess ill download it
333fred
333fred2mo ago
Hmm, x86? That's not right
333fred
333fred2mo ago
Let's start by downloading the 64-bit dotnet installer from https://dot.net
Microsoft
.NET | Build. Test. Deploy.
.NET is a developer platform with tools and libraries for building any type of app, including web, mobile, desktop, games, IoT, cloud, and microservices.
Rook
Rook2mo ago
just installed it but its saying the same thing
333fred
333fred2mo ago
I'm guessing your PATH is messed up Do you know how to edit your environment variables?
Rook
Rook2mo ago
no not really
333fred
333fred2mo ago
https://www.howtogeek.com/787217/how-to-edit-environment-variables-on-windows-10-or-11/ looks like a decent enough tutorial. You want to go remove C:\Program Files (x86)\dotnet from your PATH
Rook
Rook2mo ago
I dont have a variable named "PATH" wait nvm
333fred
333fred2mo ago
Yeah, you definitely do 😄 If you didn't your computer wouldn't boot
Rook
Rook2mo ago
delete this right
No description
333fred
333fred2mo ago
Yes
Rook
Rook2mo ago
ok done
333fred
333fred2mo ago
Now, open a new command prompt (existing prompts won't see the change) and run dotnet --info
Rook
Rook2mo ago
No description
333fred
333fred2mo ago
Alright, much better Guessing you'll be able to make a new project in VS now
Rook
Rook2mo ago
okay its made it with no error actually i think its all good I dont know where you learned all of this, but thank you so much 🙏
333fred
333fred2mo ago
8 years on the .NET team will do that to you 😄 If everything's good, make sure to $close the thread
MODiX
MODiX2mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Rook
Rook2mo ago
/close
Want results from more Discord servers?
Add your server