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