C
C#•10mo ago
Jacob

Error on VS Code on M1 Mac

I have installed all C# extenstions that are needed, though I am still getting an error. Screenshot attached.
No description
44 Replies
SinFluxx
SinFluxx•10mo ago
Is there a specific reason you're using scriptcs rather than creating a proper Project?
Jacob
JacobOP•10mo ago
not sure what is scriptcs
SinFluxx
SinFluxx•10mo ago
it's what's in your screenshot 🙂
Jacob
JacobOP•10mo ago
I know. Though I havent installed anything titled "scriptcs: just all vscode extensions for c#
SinFluxx
SinFluxx•10mo ago
What are "all" the extensions you installed? And how did you create the file/project you're working on? Did you follow these instructions: https://learn.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-8-0
Create a .NET console application using Visual Studio Code - .NET
Learn how to create a .NET console application using Visual Studio Code and the .NET CLI.
Jacob
JacobOP•10mo ago
No description
Buddy
Buddy•10mo ago
C# is project based Scriptcs is a 3rd party tool. Please use dotnet new console
Jacob
JacobOP•10mo ago
new to coding so pardon me. Though, to my understanding. A project is created via making a project folder, and programs files into that folder correct?
Buddy
Buddy•10mo ago
Which will create a project with template console C# requires a csproj It is not like python where you can just execute the program with a single .cs file It needs to be compiled into an executable.
Jacob
JacobOP•10mo ago
ah right thats how i was running it into terminal?
Buddy
Buddy•10mo ago
Yes. That will create a new console project in current directory
Jacob
JacobOP•10mo ago
No description
Jacob
JacobOP•10mo ago
from here. i would open this in vs code?
Buddy
Buddy•10mo ago
After that you open the folder where the csproj exists if you are using VSCode
Jacob
JacobOP•10mo ago
No description
Jacob
JacobOP•10mo ago
seems like i cant?
SinFluxx
SinFluxx•10mo ago
In vscode open the Folder that file is in
Jacob
JacobOP•10mo ago
that file isnt in any folder i cant drag it neither
Jacob
JacobOP•10mo ago
No description
Buddy
Buddy•10mo ago
It literally is
SinFluxx
SinFluxx•10mo ago
The folder is "jacob"
No description
Jacob
JacobOP•10mo ago
oh lol
Buddy
Buddy•10mo ago
It was created in /Users/jacob
Jacob
JacobOP•10mo ago
right right
Buddy
Buddy•10mo ago
So you open the jacob folder
Jacob
JacobOP•10mo ago
okay so two questions. I dont like that its in the jacob folder. its filled with too much stuff. i just want the c# project. how would i change the directory. also. i opened the folder. now what?
Jacob
JacobOP•10mo ago
No description
Jacob
JacobOP•10mo ago
this is that jacob.csproj opens up to
SinFluxx
SinFluxx•10mo ago
You would start writing your code in the Program.cs file or create new .cs files as your program grows
Jacob
JacobOP•10mo ago
No description
Jacob
JacobOP•10mo ago
ah i see. though im still getting this error upon running
SinFluxx
SinFluxx•10mo ago
if you want to run your app do: dotnet run
Jacob
JacobOP•10mo ago
in the vs code terminal?
SinFluxx
SinFluxx•10mo ago
yeah
Buddy
Buddy•10mo ago
Uninstall that extension too
Jacob
JacobOP•10mo ago
scriptcs? what would be the terminal command to uninstall it. i dont see it in the vscode extension s
SinFluxx
SinFluxx•10mo ago
are you just typing in the scriptcs command because you read it somewhere, and you don't actually have anything for it installed?
Jacob
JacobOP•10mo ago
im not typing anything. im just running and thats what pops up dotnet run doesnt seem to do anything
Jacob
JacobOP•10mo ago
No description
SinFluxx
SinFluxx•10mo ago
Should just print
No description
Jacob
JacobOP•10mo ago
yea thats odd
Buddy
Buddy•10mo ago
Are you in the correct directory with the terminal? $vscode
MODiX
MODiX•10mo 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
Buddy
Buddy•10mo ago
Follow this
Want results from more Discord servers?
Add your server