Command not found csc on Debian

I recently inherited a .NET application, written in C#. I know little to nothing
about any of the aforementioned, but I do know how to use a web search and/or
AI chat bot to figure things out.

That being said, I installed Mono locally, as one does when they are attempting
to run .NET code on a Linux machine, in my case, on a Debian install.

Lo and behold, mono ran fine, but that’s for running compiled executables.

The csharp command also ran run, but that’s an interactive C# REPL.

Seems like the thing I wanted was csc, the C# compiler, so I could take the
.cs file I had and compile that to an .exe which could then be executed with
mono.

Keep in mind, I learned this from what I would consider a reputable source, the
Mono Project documentation.

Of course, when I went to run that and was greeting with:

% csc
zsh: command not found: csc

Already pretty salty that I am needing to work with a .NET application,
considering the entirety of our existing stack is in Node.js, I got to
sleuthing around, as I wasn’t going to let this beat me.

Sure, I could have ventured into using the mono Docker image, but I really
wanted to get things running locally before attempting to Dockerize things.

So turns out, on Debian, the command isn’t csc, it’s mono-csc.

Why? No freakin’ clue. It would have made a bit more sense if all of the
commands were prefixed that way, so csharp was mono-csharp but that wasn’t
the case at all.

Mystery solved, with more mysteries to unravel as I try to get the app in it’s
entirety running on Linux, and not just an individual .cs file.

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.


If you found this article helpful, please consider buying me a coffee.