真的只有兩種可能。一,你的路徑不正確。試試這個:
C:\Windows\Microsoft.NET>path
PATH=C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Micros
oft Shared\Microsoft Online Services;c:\Program Files (x86)\AMD APP\bin\x86_64;c:\Program Files (x86)\AMD APP\bin\x86;C:
\oraclexe\app\oracle\product\11.2.0\server\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System
32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;c:\Program Files (x86)\Microsoft SQL Server\100\To
ols\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\P
rogram Files (x86)\Java\jre6\bin;C:\Program Files (x86)\Graphviz 2.28\bin;C:\Program Files (x86)\1E\SMSNomad\;C:\Program
Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\IronRuby 1.1\bin;C:\Program Files\Microsoft\W
eb Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL S
erver\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.8.0.0\
C:\Windows\Microsoft.NET>csc
'csc' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\Microsoft.NET>set path=%path%;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
C:\Windows\Microsoft.NET>csc
Microsoft (R) Visual C# Compiler version 4.0.30319.17929
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
warning CS2008: No source files specified
error CS1562: Outputs without source must have the /out option specified
C:\Windows\Microsoft.NET>
如果不工作,然後驗證CSC.EXE確實是在正確的位置:
C:\Windows\Microsoft.NET>dir C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /b
csc.exe
如果沒有找到它,嘗試做:
C:\Windows\Microsoft.NET>dir csc.exe /s /b
C:\Windows\Microsoft.NET\Framework\v1.1.4322\csc.exe
C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe
C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe
C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe
查看它是否在不同的目錄中。也許你已經安裝了另一個版本的框架,或者沒有64位的操作系統。
「路徑」命令的輸出是什麼? –
您獲得完整版本afaik。只需使用Visual Studio命令提示符,開始+所有程序即可找到它。 –
您是否使用VS2012的開發人員命令提示符?在'C:\ Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ Tools'中查找名爲'VsDevCmd.bat'的蝙蝠文件。 –