28
submitted 11 months ago by ProgKing@lemmy.ml to c/linux@lemmy.ml

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.

top 14 comments
sorted by: hot top controversial new old
[-] mrbn@lemmy.ca 9 points 11 months 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.

[-] skullgiver@popplesburger.hilciferous.nl 3 points 11 months ago* (last edited 7 months ago)

[This comment has been deleted by an automated system]

[-] luthis@lemmy.nz 3 points 11 months ago

Omnisharp was a pain to get working properly.

[-] garam@lemmy.my.id 2 points 11 months ago

It's not on Fedora or EL based distro

[-] nottheengineer@feddit.de 2 points 11 months ago

C# is microsoft, so you'll want to use windows for that or pick a better language to learn.

[-] Nucleus96@lemmy.cwain.dk 27 points 11 months 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 -1 points 11 months 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.

[-] Decker108@lemmy.ml 7 points 11 months ago

Don't use mono, use dotnet core instead.

[-] garam@lemmy.my.id 1 points 11 months ago

Avalonia in Linux does it job for almost case.... it's crazy tbh..

[-] NixDev@programming.dev 5 points 11 months ago

I have been going through Azure training for work and I have been doing all my training/dev on Arch. I haven't run into any issues with c#. Haven't had to use Omni Sharp that I can recall but vscode has been working fine with c#

[-] jemorgan@lemm.ee 4 points 11 months ago

Sounds like user error.

[-] Kushia@lemmy.ml 4 points 11 months ago

It used to be this way yes, not anymore.

[-] pipe01@lemmy.pipe01.net 2 points 11 months ago

Make sure you install the C# Dev Kit extension, the C# extension alone won't do it.

[-] excitingburp@lemmy.world 1 points 11 months 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.

this post was submitted on 01 Aug 2023
28 points (100.0% liked)

Linux

45443 readers
1932 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS