[英]How to generate IL source code with csc (C# compiler) or dmcs (mono C# compiler)?
[英]csc compiler for C# code
我正在使用Visual Studio2015。我認為它使用Microsoft Visual Studio 14.0 \\ VC \\ bin文件夾中的cl.exe編譯器來編譯C ++代碼。 另外,我的理解是,用於編譯C#代碼的編譯器是csc.exe。 但是,我在視覺工作室(如cl.exe)中找不到此csc.exe。 我很好奇,然后知道Visual Studio如何編譯C#代碼。 我認為Visual Studio使用.Net附帶的csc.exe(通常安裝在C:\\ Windows \\ Microsoft.NET \\ Framework \\\\ csc.exe中)來編譯C#代碼。 我的理解正確嗎?
我無法回答為什么VS 2015安裝目錄中不存在Roslyn。 但是您可以檢查Visual Studio如何在輸出窗口中運行csc.exe。
轉到Tools->Options->Projects and Solutions->Build and Run
,然后選擇Tools->Options->Projects and Solutions->Build and Run
輸出的詳細程度。 (您可以選擇最詳細的選項)
然后構建您的程序。 然后,您可以在輸出窗口中檢查MSBuild
使用的命令行。
哦,我正在使用VS 2017 ...
C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ Professional \\ MSBuild \\ 15.0 \\ Bin \\ Roslyn \\ csc.exe / noconfig / nowarn:1701,1702,2008 / nostdlib + / platform:anycpu32bitpreferred ...的開關省略)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.