C
C#2y 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
RonnieOP2y ago
Im very new to C#
Buddy
Buddy2y ago
http://scriptcs.net/ It is deprecated and should not be used
Ronnie
RonnieOP2y ago
huh?
Buddy
Buddy2y ago
You need a program
Ronnie
RonnieOP2y ago
how do i change this?
Buddy
Buddy2y ago
$vscode
MODiX
MODiX2y 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
Buddy2y ago
if you want to run C#, follow those steps instead do not use scriptcs
Ronnie
RonnieOP2y ago
oh ok thanks
Buddy
Buddy2y 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
RonnieOP2y ago
oh
Ronnie
RonnieOP2y ago
Buddy
Buddy2y ago
Great. It is a project because you have .csproj file there
Ronnie
RonnieOP2y ago
ah ok
Buddy
Buddy2y 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
RonnieOP2y ago
it looks nice
Buddy
Buddy2y ago
VSCode looks nice, sure. But honestly terrible for C#
Ronnie
RonnieOP2y ago
thats the reason i use it oh
Buddy
Buddy2y ago
Rider also looks nice, but it is premium.
Ronnie
RonnieOP2y ago
im on windows
Buddy
Buddy2y ago
It is cross-platform, which means it is available on Mac, Linux and Windows.
Ronnie
RonnieOP2y ago
ah i just ran my code, but the same error keeps on appearing
Buddy
Buddy2y ago
Follow the steps
Ronnie
RonnieOP2y ago
ive followed all the steps, i see the flame logo, im using .NET but i still get the error
Ronnie
RonnieOP2y ago
Buddy
Buddy2y ago
You're literally trying to run scriptcs which is not installed, and should not be installed.
Buddy
Buddy2y ago
Buddy
Buddy2y ago
Press that
Ronnie
RonnieOP2y ago
ohh it worked
Buddy
Buddy2y ago
blobthumbsup
Ronnie
RonnieOP2y ago
Ronnie
RonnieOP2y ago
Ronnie
RonnieOP2y ago
thank you
Buddy
Buddy2y 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
RonnieOP2y ago
as in learn it? ah
Buddy
Buddy2y ago
Yes What commands to run, etc.
Ronnie
RonnieOP2y ago
ah ok
Buddy
Buddy2y ago
editing csproj, and so on
Ronnie
RonnieOP2y ago
thanks for everything
Accord
Accord2y 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