A.s. Bhullar A.s. Bhullar - 4 months ago 42
C# Question

How can I compile and run c# program without using visual studio?

I am very new to C#. I have just run C# 'Hello World' program using Visual Studio.

Can I run or compile a C# program without using Visual Studio?

If it is possible, then which compiler should I use?



If you have the .NET v4 installed (so if you have a newer windows or if you apply the windows updates)

C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe nomefile.cs


C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe nomefile.sln


C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe nomefile.csproj

It's highly probable that if you have .NET installed, the %FrameworkDir% variable is set, so:

%FrameworkDir%\v4.0.30319\csc.exe ...

%FrameworkDir%\v4.0.30319\msbuild.exe ...