oleg-shilo / cs-script.vscode

VSCode extension for CS-Script
MIT License
37 stars 7 forks source link

"mono" not found #1

Closed Vasilich closed 7 years ago

Vasilich commented 7 years ago

Trying to use VSCode for csscript, but any command (debug, run, compile) outputs "Der Befehl "mono" ist entweder falsch geschrieben oder konnte nicht gefunden werden." (german, means "Command 'mono' is either wrong typed or cannot be found." / "Bad command or file name"). Any suggestion what can be wrong? Using latest cs-script with latest VSCode (1.12.2) on german windows 7.

oleg-shilo commented 7 years ago

Hi, the extension relies on two other extensions: image

In the previous release the dependencies were not expressed properly in the manifest file so you are probably missing Mono Debug extension and Mono itself.

You can either install Mono Debug extension manually. Or get the very latest CS-Script.VSCode update (I just published it) and VSCode should pick the dependency and install Mono Debug automatically.

Vasilich commented 7 years ago

Mono Debug was already installed. I just updated csscript.vscode to latest version, but nothing changed - same error. Yes, i don't have Mono explicitly installed - i thought it is the part VSCode itself? I just got used to use csscript without installing something additional. Should i install Mono for windows to use csscript under vscode?

oleg-shilo commented 7 years ago

My bad. I assumed that Mono came on my system with Mono Debug extension. I was wrong. It is an independent install. Please install Mono form the official Mono repo: http://www.mono-project.com/download. I just tested v5.0.1 from there it works.

Keep in mind that the official latest Mono still doesn't support C# 7 but C# 6 only. I guess it will catch up soon.

Vasilich commented 7 years ago

After installing Mono and manually adding its path to global PATH environment variable, cs-script.vscode can be compiled. I still have some problems with debugging, because i selected once .NET Core debugger, but i will solve it later. Is Mono a requirement for cs-script to be compiled/debugged in vscode? CSScript itself doesn't require it as it uses .NET available/installed in OS.

oleg-shilo commented 7 years ago

Is Mono a requirement for cs-script to be compiled/debugged in vscode?

Yes. cs-script itself does not require mono on Win. This is how cs-script is hosted in Notepad++ in a pure Win manner:

Run: cscs.exe <script>
Debug: mdbg.exe cscs.exe <script>

And this how it's done under vscode:

Run: mono cscs.exe <script>
Debug: mono --debug --debugger-agent cscs.exe <script>

Of course if it is windows, running can be done without mono but I feel that it is better to keep the same runtime for execution and debugging. Though I will allow customizing the launcher (e.g. dropping 'mono') in the future. But before that I need to collect some feedback and let the extension to mature at least a little. It is just two days old :)

I still have some problems with debugging, because i selected once .NET Core debugger...

Yes it might be a problem. I haven't use .NET Core debugger yet so my VSCode config is a default one. Though I am not entirely convinced .NET Core debugger can interfere. On cs-script.debug (Alt+F5) the extension explicitly lunches mono:

var editor = vscode.window.activeTextEditor;
let launchConfig = {
    "name": "Launch",
    "type": "mono",
    "request": "launch",
    "program": cscs_exe,
    "args": ["-nl", "-d", "-l", "-inmem:0", "-ac:2", "-config:none", editor.document.fileName]
};

vscode.commands.executeCommand('vscode.startDebug', launchConfig);

But who knows...

Vasilich commented 7 years ago

thank you Oleg, so far got everything working now.