Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 Command Line Compiler

I know this may appear to be a duplicate question, but I have been through all of the existing answers to no avail.

I have been trying to have command prompt acknowledge the command line compiler for C#, as it is neccisary for the compiler generator I am using. I am working on a fresh install of Windows 7 SP1 64bit, with Visual Studio 2012 compliments of dreamspark.

I have tried adding the "Microsoft.NET\Framework\v4.0.30319" and the "Microsoft.NET\Framework64\v4.0.30319" to the path environmental variable, tried the vsvars batch file, and still am having no luck. Command prompt simply states that "csc is not recognised as an internal or external command".

Any help would be appreciated!

like image 964
Frostie Avatar asked Nov 21 '12 21:11

Frostie


1 Answers

There's really only two possibilities. One, your path is incorrect. Try this:

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>

If that isn't working, then verify csc.exe is indeed in the correct location:

C:\Windows\Microsoft.NET>dir C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /b
csc.exe

If it isn't found, try doing:

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

To see if it's in a different directory. Perhaps you have another version of the framework installed, or do not have a 64bit OS.

like image 178
Mike Christensen Avatar answered Oct 12 '22 23:10

Mike Christensen