C
C#•5mo 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•5mo ago
Is there a specific reason you're using scriptcs rather than creating a proper Project?
Jacob
Jacob•5mo ago
not sure what is scriptcs
SinFluxx
SinFluxx•5mo ago
it's what's in your screenshot 🙂
Jacob
Jacob•5mo ago
I know. Though I havent installed anything titled "scriptcs: just all vscode extensions for c#
SinFluxx
SinFluxx•5mo 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
Jacob•5mo ago
No description
Buddy
Buddy•5mo ago
C# is project based Scriptcs is a 3rd party tool. Please use dotnet new console
Jacob
Jacob•5mo 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•5mo 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
Jacob•5mo ago
ah right thats how i was running it into terminal?
Buddy
Buddy•5mo ago
Yes. That will create a new console project in current directory
Jacob
Jacob•5mo ago
No description
Jacob
Jacob•5mo ago
from here. i would open this in vs code?
Buddy
Buddy•5mo ago
After that you open the folder where the csproj exists if you are using VSCode
Jacob
Jacob•5mo ago
No description
Jacob
Jacob•5mo ago
seems like i cant?
SinFluxx
SinFluxx•5mo ago
In vscode open the Folder that file is in
Jacob
Jacob•5mo ago
that file isnt in any folder i cant drag it neither
Jacob
Jacob•5mo ago
No description
Buddy
Buddy•5mo ago
It literally is
SinFluxx
SinFluxx•5mo ago
The folder is "jacob"
No description
Jacob
Jacob•5mo ago
oh lol
Buddy
Buddy•5mo ago
It was created in /Users/jacob
Jacob
Jacob•5mo ago
right right
Buddy
Buddy•5mo ago
So you open the jacob folder
Jacob
Jacob•5mo 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
Jacob•5mo ago
No description
Jacob
Jacob•5mo ago
this is that jacob.csproj opens up to
SinFluxx
SinFluxx•5mo ago
You would start writing your code in the Program.cs file or create new .cs files as your program grows
Jacob
Jacob•5mo ago
No description
Jacob
Jacob•5mo ago
ah i see. though im still getting this error upon running
SinFluxx
SinFluxx•5mo ago
if you want to run your app do: dotnet run
Jacob
Jacob•5mo ago
in the vs code terminal?
SinFluxx
SinFluxx•5mo ago
yeah
Buddy
Buddy•5mo ago
Uninstall that extension too
Jacob
Jacob•5mo ago
scriptcs? what would be the terminal command to uninstall it. i dont see it in the vscode extension s
SinFluxx
SinFluxx•5mo 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
Jacob•5mo ago
im not typing anything. im just running and thats what pops up dotnet run doesnt seem to do anything
Jacob
Jacob•5mo ago
No description
SinFluxx
SinFluxx•5mo ago
Should just print
No description
Jacob
Jacob•5mo ago
yea thats odd
Buddy
Buddy•5mo ago
Are you in the correct directory with the terminal? $vscode
MODiX
MODiX•5mo 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•5mo ago
Follow this