C
C#17mo ago
AtomFPS

❔ external window pls

im trying to make it so when i run it, it runs on an external window
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace gettingUserInput
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello");

Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace gettingUserInput
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello");

Console.ReadLine();
}
}
}
sadly for me it only runs on VS code internal console :(
119 Replies
Hackmagician
Hackmagician17mo ago
Launch the gettingUserInput.exe from your bin/Debug folder all you gotta do is build the project and it'll make that
AtomFPS
AtomFPSOP17mo ago
how do i make it do that when i run the script like in VS im not sure how to explain it but this
AtomFPS
AtomFPSOP17mo ago
Hackmagician
Hackmagician17mo ago
shrug
AtomFPS
AtomFPSOP17mo ago
what about maybe why i cant type on "OUTPUT"?
Hackmagician
Hackmagician17mo ago
it's output, not a terminal if you want to type go to 'Terminal' tab at the bottom
AtomFPS
AtomFPSOP17mo ago
but it runs on output not on terminal VS code is confusing w
Hackmagician
Hackmagician17mo ago
you can also do dotnet run in Terminal and that'll run your app and then you can type
AtomFPS
AtomFPSOP17mo ago
well the new one
Moods
Moods17mo ago
Tbf You should be doing dotnet run In the terminal
AtomFPS
AtomFPSOP17mo ago
freeCodeCamp.org
YouTube
C# Tutorial - Full Course for Beginners
This course will give you a full introduction into all of the core concepts in C# (aka C Sharp). Follow along with the course and you'll be a C# programmer in no time! ⭐️ Contents ⭐️ ⌨️ (0:00:00) Introduction ⌨️ (0:01:18) Installation & Setup ⌨️ (0:05:03) Drawing a Shape ⌨️ (0:17:23) Variables ⌨️ (0:30:06) Data Types ⌨️ (0:37:17) Working With S...
Hackmagician
Hackmagician17mo ago
he's using Visual Studio
AtomFPS
AtomFPSOP17mo ago
yes so am i
Hackmagician
Hackmagician17mo ago
that's why it auto-launches the .exe on build with debugger you're using Visual Studio Code
Moods
Moods17mo ago
That is not VS they are very very different
AtomFPS
AtomFPSOP17mo ago
theres a difference?
Hackmagician
Hackmagician17mo ago
yea
Moods
Moods17mo ago
Yeah
Hackmagician
Hackmagician17mo ago
Visual Studio is an IDE for .NET
AtomFPS
AtomFPSOP17mo ago
w
Hackmagician
Hackmagician17mo ago
and VSC is just a text editor
AtomFPS
AtomFPSOP17mo ago
that explains all the problems i have so dar
Moods
Moods17mo ago
You typed it twice
AtomFPS
AtomFPSOP17mo ago
thanks alot! typed what twice
Moods
Moods17mo ago
All the best Dw they edited it
Hackmagician
Hackmagician17mo ago
that was to me
Moods
Moods17mo ago
But yeah VS is a full-blown IDE
Hackmagician
Hackmagician17mo ago
if you're a beginner i recommend using Visual Studio over Visual Studio Code
AtomFPS
AtomFPSOP17mo ago
thanks ill download it
Hackmagician
Hackmagician17mo ago
it'll let you explore with IntelliSense and suggestions, and that's how you'll learn more
ero
ero17mo ago
fwiw there's a setting in the .vscode settings.json where you can specify that your program should run in an external console
AtomFPS
AtomFPSOP17mo ago
VS is a hell lot larger than VS code thats prob why it took longer to download that one time
Moods
Moods17mo ago
Yeah….
AtomFPS
AtomFPSOP17mo ago
yh guess ill wait it out
AtomFPS
AtomFPSOP17mo ago
no run?
AtomFPS
AtomFPSOP17mo ago
@ℍ
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
there's this little arrow next to the button click that and select the first thing, should be something like "gettingUserInput" with a green play button
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
like this
AtomFPS
AtomFPSOP17mo ago
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
this little arrow click it
AtomFPS
AtomFPSOP17mo ago
then? it only shows "current file"
Hackmagician
Hackmagician17mo ago
Did you open a solution? or just the files?
AtomFPS
AtomFPSOP17mo ago
whats a solution
Hackmagician
Hackmagician17mo ago
When you were opening it , did you click on either of these 2?
AtomFPS
AtomFPSOP17mo ago
i opened a folder
Hackmagician
Hackmagician17mo ago
ah that explains it in that folder, do you maybe have a file that's called gettingUserInput.sln? if you do, double click that one
AtomFPS
AtomFPSOP17mo ago
no i think wait how do you get that window thing on the right cause i closed it oh nvm
AtomFPS
AtomFPSOP17mo ago
/@ℍ
Hackmagician
Hackmagician17mo ago
ah i see you need to make a new a solution
Hackmagician
Hackmagician17mo ago
freeCodeCamp.org
YouTube
C# Tutorial - Full Course for Beginners
This course will give you a full introduction into all of the core concepts in C# (aka C Sharp). Follow along with the course and you'll be a C# programmer in no time! ⭐️ Contents ⭐️ ⌨️ (0:00:00) Introduction ⌨️ (0:01:18) Installation & Setup ⌨️ (0:05:03) Drawing a Shape ⌨️ (0:17:23) Variables ⌨️ (0:30:06) Data Types ⌨️ (0:37:17) Working With S...
Hackmagician
Hackmagician17mo ago
follow from here
AtomFPS
AtomFPSOP17mo ago
thanks
Hackmagician
Hackmagician17mo ago
after you make the solution, in the folder where your project is located you can drop your other files that way u won't have to repeat everything
AtomFPS
AtomFPSOP17mo ago
oh thanks i was worried about htat
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
oh i changed it and it works now thanks again!
Hackmagician
Hackmagician17mo ago
np
AtomFPS
AtomFPSOP17mo ago
@ℍ do i have to like do make a new project everytime i make a new file
Hackmagician
Hackmagician17mo ago
no no
AtomFPS
AtomFPSOP17mo ago
cause somehow when i tried to change the thing it executes a different file
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
you right click this and then Add > Class
AtomFPS
AtomFPSOP17mo ago
?
Hackmagician
Hackmagician17mo ago
keep the little arrow up top to be your Program.cs file, or the file where you have your Main, as that'll launch your whole app. you just add new files by clicking on your project and then add
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
this
Hackmagician
Hackmagician17mo ago
you should open the .sln file, instead of having the folder open
Hackmagician
Hackmagician17mo ago
so close out of visual studio, go to that folder and then double click this file
AtomFPS
AtomFPSOP17mo ago
Hackmagician
Hackmagician17mo ago
yep now in your folder
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
drag these
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
into this one 'CS4HOURCOUSE' folder that way they're in your project
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
still doing the wrong file
Hackmagician
Hackmagician17mo ago
that's still your folder view instead of your actual solution file open the CS4HOURCOUSE.sln
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
its not supposed to do hello world btw
Hackmagician
Hackmagician17mo ago
that's the default go to Program.cs that's where it'll say Console.WriteLine("Hello, World!");
AtomFPS
AtomFPSOP17mo ago
so i modify that instead?
Hackmagician
Hackmagician17mo ago
yeah ur Program.cs file
AtomFPS
AtomFPSOP17mo ago
but what if i want to modify another file and run it instead of Program.cs i copy pasted the code from gettingUserInput.cs to Program.cs but its still printing hello world @ℍ
Hackmagician
Hackmagician17mo ago
You need a Program.cs file with a static void Main to launch can you share screenshots
AtomFPS
AtomFPSOP17mo ago
Hackmagician
Hackmagician17mo ago
here are your errors: 1. lowercase program 2. Program is already defined
Hackmagician
Hackmagician17mo ago
copy paste everything from here into your Program.cs file
AtomFPS
AtomFPSOP17mo ago
i did
Hackmagician
Hackmagician17mo ago
you didn't
AtomFPS
AtomFPSOP17mo ago
smh this is Program.cs
Hackmagician
Hackmagician17mo ago
im clearly looking at something else kekw
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
it isn't tho
AtomFPS
AtomFPSOP17mo ago
smh wait
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
screenshot was before i pasted it lol my bad still does the same thing whatsoever
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
Program2 -> Program rename that Class and if you have another Program class, change that name to something else
AtomFPS
AtomFPSOP17mo ago
AtomFPS
AtomFPSOP17mo ago
from the other files?
Hackmagician
Hackmagician17mo ago
go in here and rename program to something else
Hackmagician
Hackmagician17mo ago
change it to like randomClass or somethin
AtomFPS
AtomFPSOP17mo ago
next? it still does the same thing
Hackmagician
Hackmagician17mo ago
you also have multiple Main methods like the one in here change it to something else
Hackmagician
Hackmagician17mo ago
AtomFPS
AtomFPSOP17mo ago
deleted those files this time fk now its working! thanks once again
Hackmagician
Hackmagician17mo ago
np
AtomFPS
AtomFPSOP17mo ago
but then again what if i want to like do another file do i have to create another "solution"
Hackmagician
Hackmagician17mo ago
no
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
you would right click the little rectangle with the green "C#" in it then Add > New Item
AtomFPS
AtomFPSOP17mo ago
oh thanks
Denis
Denis17mo ago
Could you please share, why you have chosen to use VSCode instead of Visual Studio Community 2022? Just wondering
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server