什么是 csc2.exe?

What is csc2.exe?

什么是 csc2?

Visual Studio 2013 在 C:\Program Files (x86)\MSBuild.0\Bin 中附带命令行 C# 编译器 csc.exe。我有时用它来构建小的 hello world 应用程序,例如。 csc hello-world.cs

Visual Studio 2015 仍然附带 csc.exe,但 C:\Program Files (x86)\MSBuild.0\Bin 中还有一个新的 csc2.execsc2.exe 是什么?它与 csc.exe 有何不同?

它们是新的开源 .NET 编译器平台 Roslyn 的一部分。

来自他们的CodePlex page

Building the command line compilers

Note that in most situations the compilers will NOT be invoked through csc and vbc for performance reasons, but they are the simplest way to debug. Other entry points include:

  1. csc2.exe and vbc2.exe. These are extremely small native executables that simply start or connect to a VBCSCompiler.exe process and send command line arguments to it. This allows the VBCSCompiler.exe process to reuse loaded assemblies for multiple projects.

可以找到 csc2 的来源 here。如您所见,它只是一个非常小的入门应用程序。