Sublime Forum

C# Setup for Sublime Text 4

#1

Hi all,

I am using Windows 10 and having some C# project using both .NET Framework and .NET Core.

I would like to setup C# development for my C# project.

I tried to use Omnisharp but it does not work.

Please could you help me to setup C# dev environment for my projects?

many thanks

0 Likes

#2

Hi folks,

+1 for C# for Sublime Text 4

Should we wait for it or MSFT do not want to help with that to eliminate the competition with VS Code?

1 Like

#3

There’s both OmniSharp and LSP-OmniSharp available for Sublime Text. Is there something specific that doesn’t work with them? If so, please report them to the respective issue trackers, links to which can be found on Package Control.

2 Likes

#4

Hello. There is a simpler option that does not require any third party apps.
In sublime text go to Tools-Build System-New Build System. And add the following
{
“shell_cmd”: “csc $file_base_name.cs && $file_base_name.exe”
}

And save. Now, when building in the sublime text, the program will build your file and run the .exe.

0 Likes

#5

LSP-Omnisharp provides IntelliSense features only.

Build process for complex projects is controlled by dotnet executable these days (.NET 6+), which also works for .NET 4.x targets.

The most tricky or cumbersome part is just to create/write proper *.csproj project files files with all the settings and dependencies in it and maybe *.sln a solution file. Once those exist dotnet build <solutionfile> is all you need to build your project.

VS Code also just executes the following to compile a project:

dotnet build <solutionfile> /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary
0 Likes