Compiling C# without Visual Studio
I'm new to C# and I understood that if i want to compile code without Visual Studio i need to use Roslyn, but on github it marks the latest release as .NET 6.0. Is there no way to compile C# code with .NET 8.0 as it is the latest LTS release? Visual Studio is very heavy, especially since i don't intend to use C# for big projects and my system isn't too performant.
12 Replies
you just use dotnet cli
you can download the SDK u wish to target
then u can do dotnet build or run or whichever is your goal
https://dotnet.microsoft.com/en-us/download
https://learn.microsoft.com/en-us/dotnet/core/tools/
Oh
guess i missed that, thank you
but if you're a beginner the goto is indeed visual studio u will have a much easier learning and less downtime figuring out things u dont need to worry initially
you'll already have the SDK installed if you've done any c# programming in visual studio
yeah if u installed visual studio u can just run in the cmd dotnet --info
to see which SDK u have installed
if you just want to build then you'll be navigating to the file directory containing the project with the
cd
cmd command, then using the dotnet build
command. You can show info about it with dotnet build -h
As a side note, I have no idea what you mean by the latest release being .NET 6.0
Those aren't releases, they're just tags
So this doesn't mean that roslyn works with up to .NET 6.0?
That's just a tag
oh
The latest tag is https://github.com/dotnet/roslyn/releases/tag/Visual-Studio-2022-Version-17.11.4. I pushed it 2 minutes ago
i see now, thanks everyone