問題描述
我想從命令行構建項目.是否可以在不安裝 Visual Studio 的情況下部署 C# 編譯器?
I want to build projects from the command line. Is it possible to deploy a C# compiler without installing Visual Studio?
推薦答案
當然,框架包含一個編譯器,csc.exe.看看 這篇文章快速入門.重要部分:
Sure, the framework includes a compiler, csc.exe. Look at this article for a quick how-to. The important parts:
您可以從 Microsoft 站點獲取命令行編譯器 (csc.exe)http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx.
You can get the command-line compiler (csc.exe) from Microsoft site http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx.
下載 .NET Framework 的可再發行包,其中包括編譯器和支持 C# 2005 語法的 .NET Framework.
Download the redistributable package of the .NET Framework, which includes the compiler and the .NET Framework with C# 2005 syntax support.
編譯器位于以下目錄:%windir%Microsoft.NETFramework
The compiler is located in the following directory: %windir%Microsoft.NETFramework
另請參閱 這篇 MSDN 文章完整的指南和解釋.
Also look at this MSDN article for a full guide and explanation.
請注意,對于更新的版本,您將尋找 MSBuild 獨立包而不是框架 - 請參閱 @Vadzim 的答案.
Note that for more recent versions, you will be looking for the MSBuild standalone package rather than the framework -- see @Vadzim's answer.
這篇關于是否可以在沒有 Visual Studio 的情況下安裝 C# 編譯器?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!