✅ Syntax Error

I'm very new to this so I tried to code something pretty basic in C# using Microsoft Visual Code. But the text isn't changing how it's supposed to and the code doesn't work. Can someone help me figure out what I'm somehow doing wrong?
No description
44 Replies
Salman
Salman6mo ago
you're missing a semicolon on first line of code. using System;
Insert display name here
one more thing
Salman
Salman6mo ago
sure
Insert display name here
if i'm correct, two of the lnes should really look like this
Insert display name here
but in the file, they're blue not yellow
Angius
Angius6mo ago
Depends on the IDE's color scheme
Salman
Salman6mo ago
try after putting the semicolon on first line as I said
Angius
Angius6mo ago
VS by default has a very same-y color scheme, IME
Insert display name here
i did
Salman
Salman6mo ago
ah okay. By default the VS should color functions as yellow but not sure what's the case there maybe restart the VS
Insert display name here
both of these screenshots are the same editor some color scheme okay it didn't do anything
Salman
Salman6mo ago
no idea then is the code working fine now?
Insert display name here
when it starts, its yellow no
Salman
Salman6mo ago
what's the issue or error
SG97
SG976mo ago
did you create a project for this?
Insert display name here
yeah, why?
SG97
SG976mo ago
I find it very odd for VSC to not display a red squiggly for the using System
Angius
Angius6mo ago
Did you open that project, or just the file? What's the solution explorer look like?
SG97
SG976mo ago
not to mention the syntax coloring being wonky
Salman
Salman6mo ago
@Scorpion have you installed the C# DevKit Extension
Insert display name here
i have
SG97
SG976mo ago
like ZZZ mentioned, how did you open that file
Insert display name here
when I made it? or right now?
SG97
SG976mo ago
when you opened the editor, how did you open the file Open folder / Open file which one
Insert display name here
folder
Salman
Salman6mo ago
@Scorpion can you share the screenshot of your VSC window
Salman
Salman6mo ago
okay so the project isn't properly created
SG97
SG976mo ago
solution explorer?
Angius
Angius6mo ago
Do you have a .csproj file?
Insert display name here
its .cs
Angius
Angius6mo ago
So you did not, in fact, create a project Close VS Code Open the terminal where you want the project to be mkdir MyCoolProject && cd MyCooProject dotnet new console code .
Insert display name here
PS C:\Users-----------------> dotnet new console
The command could not be loaded, possibly because: * You intended to execute a .NET application: The application 'new' does not exist. * You intended to execute a .NET SDK command: No .NET SDKs were found. Download a .NET SDK: ://aka.ms/dotnet-download Learn about SDK resolution: ://aka.ms/dotnet/sdk-not-found
Angius
Angius6mo ago
Do you have a .NET SDK installed? dotnet --info
Insert display name here
i think so but im not sure how to check....
Angius
Angius6mo ago
dotnet --info
Insert display name here
k No. I didn't think about that
Salman
Salman6mo ago
$vscode
MODiX
MODiX6mo ago
Follow the instructions here on getting started with DevKit for C# in VSCode: https://code.visualstudio.com/docs/csharp/get-started
Get started with C# and .NET in Visual Studio Code
Getting Started with C# and .NET Development in Visual Studio Code
Salman
Salman6mo ago
Follow these instructions
Buddy
Buddy6mo ago
Why are you hiding the file name and namespace?
Insert display name here
no clue tbh
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server