BLUF (which is almost the same as TL; DR): Try searching for “Code Lint”
Textbooks on compilers (I’ve actually read two, decades ago) have chapters on error detection, and it’s a hard problem. Visual Studio and/or MonoDevelop are probably about as good as you get for syntax issues in C#, but even then, something as simple as pointing to where you made the typo is hard, because it has to assume what you meant versus what you wrote, and will likely assume wrong. E.g. A string that goes on forever…that end quote might be meant to go about anywhere. (though I do wish more compilers, when they detect a string going forever, would point you to the Beginning of the string, not the End—which is the end of the program—as they often do…)
Another kind of error, not caught by the compiler is a logic error—and the best you can do is “lint”—try searching for “code lint” maybe. All that does is run heuristics that spot common patterns for mistakes (e.g. “=” when you meant “==”). The downside is the first time it’s run on a piece of code, it will find maybe hundreds of “suspicious” code, only one of which might be the actual error. Hence some programmers go through a lot of effort to avoid writing suspicious code so that such “linters” can be more useful.
Visual Studio might have a built-in C# linter; I don’t know, probably burried in one of the menus somewhere.