C
C#16mo ago
Ronnie

❔ ✅ Error -> scriptcs : The term 'scriptcs' is not recognized as the name of a cmdlet, function...

using System;

namespace CSharp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
using System;

namespace CSharp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
Getting this error: scriptcs : The term 'scriptcs' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
40 Replies
Ronnie
Ronnie16mo ago
Im very new to C#
Buddy
Buddy16mo ago
http://scriptcs.net/ It is deprecated and should not be used
Ronnie
Ronnie16mo ago
huh?
Buddy
Buddy16mo ago
You need a program
Ronnie
Ronnie16mo ago
how do i change this?
Buddy
Buddy16mo ago
$vscode
MODiX
MODiX16mo ago
1) Install the C# extension 2) 2.a) DO NOT USE OPEN FILE 2.b) Always use Open Folder (from the File menu), and open the folder containing your sln file (or the folder containing the csproj if you have only one csproj) 3) To make the extension start and detect C#, either: 3.a) wait for the prompt that will appear on the bottom right of your screen that ask you if you want it to create some files, and say Yes 3.b) Command Palette (F1 or Ctrl+Shift+P) and type > .Net : Generate Assets for build and run 4) you should see a flame on the Status bar with the Omnisharp logo (see second attached screenshot) 5) it should load to finally say OmniSharp server is running (if not ask for help) https://media.discordapp.net/attachments/569261465463160900/1006652191689429022/unknown.png https://cdn.discordapp.com/attachments/569261465463160900/951015732769079336/unknown.png
Buddy
Buddy16mo ago
if you want to run C#, follow those steps instead do not use scriptcs
Ronnie
Ronnie16mo ago
oh ok thanks
Buddy
Buddy16mo ago
As C# is not like Python, you can't simply create a file and you're good to go. You need a project.
Ronnie
Ronnie16mo ago
oh
Ronnie
Ronnie16mo ago
Buddy
Buddy16mo ago
Great. It is a project because you have .csproj file there
Ronnie
Ronnie16mo ago
ah ok
Buddy
Buddy16mo ago
I would not recommend using VSCode as a beginner, it is a lot of manual work. I would recommend Visual Studio Community if you're on Windows and Rider if you're on Mac / Linux.
Ronnie
Ronnie16mo ago
it looks nice
Buddy
Buddy16mo ago
VSCode looks nice, sure. But honestly terrible for C#
Ronnie
Ronnie16mo ago
thats the reason i use it oh
Buddy
Buddy16mo ago
Rider also looks nice, but it is premium.
Ronnie
Ronnie16mo ago
im on windows
Buddy
Buddy16mo ago
It is cross-platform, which means it is available on Mac, Linux and Windows.
Ronnie
Ronnie16mo ago
ah i just ran my code, but the same error keeps on appearing
Buddy
Buddy16mo ago
Follow the steps
Ronnie
Ronnie16mo ago
ive followed all the steps, i see the flame logo, im using .NET but i still get the error
Ronnie
Ronnie16mo ago
Buddy
Buddy16mo ago
You're literally trying to run scriptcs which is not installed, and should not be installed.
Buddy
Buddy16mo ago
Buddy
Buddy16mo ago
Press that
Ronnie
Ronnie16mo ago
ohh it worked
Buddy
Buddy16mo ago
blobthumbsup
Ronnie
Ronnie16mo ago
Ronnie
Ronnie16mo ago
Ronnie
Ronnie16mo ago
thank you
Buddy
Buddy16mo ago
Anytime. But again, I would not recommend VSCode for beginners. As there is a lot of manual work. You have to know dotnet CLI. https://learn.microsoft.com/en-us/dotnet/core/tools/
Ronnie
Ronnie16mo ago
as in learn it? ah
Buddy
Buddy16mo ago
Yes What commands to run, etc.
Ronnie
Ronnie16mo ago
ah ok
Buddy
Buddy16mo ago
editing csproj, and so on
Ronnie
Ronnie16mo ago
thanks for everything
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
More Posts