Is it possible to install a C# compiler without Visual Studio?

后端 未结 11 2175
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 21:32

I want to build projects from the command line. Is it possible to deploy a C# compiler without installing Visual Studio?

相关标签:
11条回答
  • 2020-11-29 22:05

    Contrary to what some of the other answerers say, you do NOT need the SDK, just the .NET Framework to get the C# compiler, csc.exe.

    Also, consider other (free) IDEs like MonoDevelop, #develop, and Visual C# Express. (You said you don't want Visual Studio, not that you don't want an IDE at all ;) )

    0 讨论(0)
  • 2020-11-29 22:06

    Assuming you have Visual Studio installed with C# included. Also, assuming you want latest version.

    1. Find the path to your VS installation. Call it VSPath.
    2. The CSC Compiler will be at VSPath\MSBuild(MSBuild-Version)\Bin\Roslyn
    0 讨论(0)
  • 2020-11-29 22:11

    Yes, if you have the .NET SDK, it's there. For example,

    C:\WINDOWS\Microsoft.NET\Framework\v[your version number]\csc.exe
    

    msbuild.exe should be there too, and you can use that to build project (.csproj) files.

    0 讨论(0)
  • 2020-11-29 22:14

    Yes, but you need to download and install .NET Framework SDK.

    Here's a link that can help you.

    0 讨论(0)
  • 2020-11-29 22:15

    You only need the .NET framework. You can use Notepad to edit and the CSC.exe to compile.

    0 讨论(0)
提交回复
热议问题