Jetbrains Rider free for personal use. You must use .net (core) on Linux, it works like a charm. Visual studio code is fine too but you need tons of plugins to have an IDE experience in .Net. You might have a problem with your .net installation id you can’t compile a simple program. How did you install .net? From microsoft’s ppa?
You don’t need to use vscode, any text editor is fine. Try to follow the getting started tutorial on microsoft’s website to see if your dotnet configuration is correctly installed. https://learn.microsoft.com/en-us/dotnet/core/get-started