I tried to use Visual Studio Code a few times. One time, I encountered an error related to OmniSharp, though I don’t remember the exact details. However, Python worked fine, for example. Then, I reinstalled Arch, and now I’ve decided to try using Visual Studio Code again because I need it to learn programming. Unfortunately, I just can’t make it work. When I start debugging, nothing happens—no errors, nothing…

I have installed everything needed(.net-sdk, mono). However, the problem is that I just can’t work with it properly. I am unable to run the debugger. When I press F5 and select a debugger, nothing happens. I managed to run a ‘hello world’ using the ‘dotnet run’ command, but that’s all. I have no idea how to fix it, and I can’t find any information about my issue.

  • mrbn@lemmy.ca
    link
    fedilink
    arrow-up
    9
    ·
    1 year ago

    Have you tried setting a breakpoint and seeing if it hits? Assuming the app you are debugging is just a Console.WriteLine("Hello World"); and no breakpoints are set, the app will execute, output hello world, and terminate. Which means you wouldn’t see anything happen in VS Code.

    If you are super new to all this, I would suggest you look for videos/articles on how to debug using visual studio code as they may provide some insights or concepts you may not already know.

  • excitingburp@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    It’s been a hot minute since I’ve used vscode, but you want to invoke the command pallet (Ctrl+P I think) and create a build profile/task/something. You then want to do the same for a debug profile. This will create two files under .vscode - you will need to edit the debug one to add the build task as a dependency for the debug profile.

    You could also try running dotnet build in the terminal before doing what you are doing already.

    Also vscodium won’t work, the debugging plugin is closed source and is only available for vscode.

    • Nucleus96@lemmy.cwain.dk
      link
      fedilink
      English
      arrow-up
      26
      ·
      1 year ago

      Username checks out

      Your comment is not entirely correct. C# is invented by Microsoft, but today runs equally well on practically all platforms including Linux, MacOS, Windows, IOS, Android etc. It even runs as WebAssembly.

      • nottheengineer@feddit.de
        link
        fedilink
        arrow-up
        0
        arrow-down
        8
        ·
        1 year ago

        Last time I tried to get a C# application running on linux, I got so frustrated of the mess that is mono and just ran it through wine. C# is still windows first, even if it theoretically works with any OS.