C
C#11mo ago
guuuh

Newbie to programing need help setting up c#

Hey, just started coding, ive worked with c++ briefly but already have forgotten everything lol. im trying rn c# mostly for school but i am pretty interested learning about .net structures i wonder if i could get some help with it? everything just thows out errors even if its just a simple ''hello world'' print
41 Replies
guuuh
guuuhOP11mo ago
it throws out a compiler error
Vi Ness
Vi Ness11mo ago
What does the error say?
Pobiega
Pobiega11mo ago
Gonna need more $details here.
MODiX
MODiX11mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
Pobiega
Pobiega11mo ago
What did you install? How did you create your project? How are you building it? How are you running it? What are you writing your code in?
guuuh
guuuhOP11mo ago
[{ "resource": "/e:/ARTY/Coding/my firs5t prooaia/first.cs", "owner": "_generated_diagnostic_collectionname#1", "code": { "value": "CS0260", "target": { "$mid": 1, "path": "/query/roslyn.query", "scheme": "https", "authority": "msdn.microsoft.com", "query": "appId=roslyn&k=k(CS0260)" } }, "severity": 8, "message": "Missing partial modifier on declaration of type 'Program'; another partial declaration of this type exists", "startLineNumber": 3, "startColumn": 7, "endLineNumber": 3, "endColumn": 14 }] and as a test im just usimg this: using System; class Program { static void Main() { Console.WriteLine("Hello, World!"); } } i was folowing a guide on youtube, i downloaded a .net sdk, got the c# dev kit and extension on vs code
Pobiega
Pobiega11mo ago
You have more code than that its complaining that you have declared the Program class twice, once with partial show a screenshot of your project directory?
guuuh
guuuhOP11mo ago
whats that?
Pobiega
Pobiega11mo ago
we highly recommend NOT using vs code as a beginner the folder where your code is
guuuh
guuuhOP11mo ago
No description
guuuh
guuuhOP11mo ago
guh my course requires it
Pobiega
Pobiega11mo ago
you have two .cs files okay thats fine then
guuuh
guuuhOP11mo ago
what do i do now?
Pobiega
Pobiega11mo ago
you have TWO files with code in it you only posted the content of one open both and compare
guuuh
guuuhOP11mo ago
its just this on the second one
No description
Pobiega
Pobiega11mo ago
ah see delete your first.cs
guuuh
guuuhOP11mo ago
okay
Pobiega
Pobiega11mo ago
that Program.cs you have is the default main entry point it contains wahts called "top level statements" code, which actually is the content of a main method on a program class thats why you are getting your "weird" error, because you used Program as your class name and thats a bit special
guuuh
guuuhOP11mo ago
ohh i think i get it getting more errors lmao
Pobiega
Pobiega11mo ago
I can't read your mind or see your screen, y'know
guuuh
guuuhOP11mo ago
true true, wanna maybe call if you are free ?
Pobiega
Pobiega11mo ago
not free post your errors here
guuuh
guuuhOP11mo ago
No description
Pobiega
Pobiega11mo ago
so you didn't remove the file?
guuuh
guuuhOP11mo ago
oh i have to like compleatly delete it?
Pobiega
Pobiega11mo ago
thats what I said no?
Pobiega
Pobiega11mo ago
No description
guuuh
guuuhOP11mo ago
okay yee no errors but i get no output
Pobiega
Pobiega11mo ago
dotnet run in the terminal
guuuh
guuuhOP11mo ago
No description
guuuh
guuuhOP11mo ago
is it posible to get it on a seperate screen? like the output
Pobiega
Pobiega11mo ago
sure, open an external terminal on your other screen and run dotnet runfrom thhere
guuuh
guuuhOP11mo ago
No description
Pobiega
Pobiega11mo ago
you gotta be in the right folder lol
guuuh
guuuhOP11mo ago
how do i do that?
Pobiega
Pobiega11mo ago
cd just google "how to use the terminal in windows" or something
guuuh
guuuhOP11mo ago
alright
Pobiega
Pobiega11mo ago
this is a very important core skill for advanced computer usage
Denis
Denis11mo ago
Even though the course "requires", I'd still do my best to use Visual Studio Community instead. You'll save yourself from so many headaches...
Pobiega
Pobiega11mo ago
Agreed
guuuh
guuuhOP11mo ago
alright!
Want results from more Discord servers?
Add your server