0

I'm just trying to program in C# lol. Why is Visual Studio Code giving me so much trouble? When I searched for this error it led me to this post

ScriptCS 0.17.01 Error Unexpected named argument

When I try and change the json.settings with the following

{
    "[jsonc]": {
        "code-runner.executorMap": { "csharp": "scriptcs -script" },

        "editor.quickSuggestions": {
            "strings": true
        },
        "editor.suggest.insertMode": "replace"
    }
}

But then I get THIS error: This setting does not support per-language configuration.

Please help me out, it's becoming extremely frustrating. I've uninstalled and reinstalled VS Code multiple times.

REVISION:

This is the code:

using System;

namespace HelloCS
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, C#!");
        }
    }
}

 

What runs in the console:

    [Running] scriptcs -script "/Users.....
    Copying directory 'bin' to 'scriptcs_bin'...
    
    [Done] exited with code=0 in 2.174 seconds

So nothing prints out.

  • did you edit `json.settings` or `settings.json`? – greenjaed Jan 22 '21 at 00:12
  • settings.json -- I apologize in advance. I am brand new to VS Code, this is on my Mac btw –  Jan 22 '21 at 00:21
  • 1
    Have you tried moving the `code-runner.executorMap` setting outside of the `jsonc` block? I don't think it belongs under that setting. – greenjaed Jan 22 '21 at 00:34
  • So that worked, but nothing is printing out in the console. Please see my edit above - or maybe it's not supposed to? –  Jan 22 '21 at 01:16
  • I haven't used it personally, but from what I understand ScriptCS is meant to be a way to run c# scripts, not really as a compiler. Have you running it with just: `using System; Console.WriteLine("Hello, C#!");`? – greenjaed Jan 22 '21 at 16:41

0 Answers0