12 Replies
that's not an error
as long as you don't get any errors trying to actually use types in your code your usings are fine, you potentially have global usings defined in the project making the one in this file redundant
nothing happens when i run the code which is the issue
well, your program sets the title and the foreground color then immediately exits
so 1) you have to be running this in an actual console window and not VS/Code's terminal to see any of that code do something and 2) you probably want to add a pause so the window doesn't close immediately when you run it
how would i run it in a console window? sorry for the basic questions, python was quite a lot simpler.
either double click the exe produced by
dotnet build
or open cmd/powershell, go to the project directory, and dotnet run
it would probably help to print some actual text to the console so there's more to seeyep ive added that, just figuring out the dotnet build rn
Additionally you can click run if you use Visual Studio :kadse:
it will put an exe in
bin/Debug/net8.0/
iircfollowing this youtube guide its supposed to open up a cmd window to display my "Hello World" text, which it doesnt quite do and instead sends it to the terminal in vsc, any way i can change this?
yeah, don't run it through vsc
or find a relevant setting in the C# extension to make it use a standalone console window
i'm going to guess the tutorial you're following is using VS which would show a standalone window by default
(and is generally a better option for C# than VSC)
ahhh
that would make a lot of sense, yes, ill be downloading VS, thank you for all your help 😄
+rep to you mr jimmacle