✅ New to visual studio why are my Console.Write/ReadLines white?
Im trying to make a console app with .net
64 Replies
Did you open a project? Or just a random cs file?
Project
Can you take a screenshot of your solution explorer?
And does your project build?
No its doesnt build
Well it builds just not the latest version
That just means it doesn't build
Where do i find solution explorer?
Just take a screenshot of VS entirely
Yeah, so see how it says "Miscellaneous Files" at the top-left there?
yeah
That means it's not actually the
Program.cs
file from your projectso how do i use the program.cs
Double-click on the
Program.cs
in your project
(Note: the window on the right, titled "Solution Explorer", is your solution explorer)Nothing happens
ohh right thank you
Close the file and try again
its still the same
It still says misc files?
yeah
If you click the dropdown, do you see any other options?
no
Also, I just realized, you're using .NET Framework
Did you intentionally choose that?
I did but idk if i should be
$newproject
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
I would delete your current project and start over, this time using a modern .NET option
This one?
Yes
It says miscellanous files top left again
Did you delete the old project?
And not make the new project in the same location as the old project?
Okay ive deleted them all
this error comes up fater i make the project
Uh, what happens if you open a comment prompt and run
dotnet --list-sdks
I cant even run it, it says attach
huh?
look
idk if i did the prompt right but where start normally is. Theres attach
Nono
Literally open a command prompt
This isn't a vs thing
ohh
:squint:
Alright, uh, something is broken in your install
😔
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 lineThat last line was step 3, sorry
i guess ill download it
Hmm, x86? That's not right
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.
just installed it but its saying the same thing
I'm guessing your PATH is messed up
Do you know how to edit your environment variables?
no not really
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
I dont have a variable named "PATH"
wait nvm
Yeah, you definitely do 😄
If you didn't your computer wouldn't boot
delete this right
Yes
ok done
Now, open a new command prompt (existing prompts won't see the change) and run
dotnet --info
Alright, much better
Guessing you'll be able to make a new project in VS now
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 🙏
8 years on the .NET team will do that to you 😄
If everything's good, make sure to $close the thread
If you have no further questions, please use /close to mark the forum thread as answered
/close