LSP-OmniSharp icon indicating copy to clipboard operation
LSP-OmniSharp copied to clipboard

Doesn't Support Top-Level Satements (.NET 6)

Open j0of opened this issue 2 years ago • 2 comments

I prefer to use .NET 6 when coding in C# so that I don't have to declare using System; or the main method, but I get an error whenever I don't. image

j0of avatar Mar 20 '23 20:03 j0of

I can verify a .NET 6 project does not work either. So, the problem might be lack of net6.0 support in general.

beautifulcoder avatar Mar 21 '23 18:03 beautifulcoder

On further inspection, net6 support works when you only have the .NET SDK installed. If you install both Framework, and .NET Core on Windows then only Framework seems to work with Omnisharp. My guess is this is an msbuild limitation.

beautifulcoder avatar Jun 29 '23 20:06 beautifulcoder

Should be fixed by PR https://github.com/sublimelsp/LSP-OmniSharp/pull/40, which makes transition to latest .NET 6+ based OmniSharp binaries. They are required to deal with latest .NET projects.

deathaxe avatar Sep 15 '24 10:09 deathaxe