‘csc’ is not recognized as an internal or external command, operable program or batch file [duplicate]

Locate the path of csc.exe and add it your PATH environment variable. In my case, the path for 64-bit C# compiler is C:\Windows\Microsoft.NET\Framework64\v4.0.30319. Similarly, you can look for 32-bit C# compiler in C:\Windows\Microsoft.NET\Framework under different .NET framework version directories There will be csc.exe for all versions like v2.0.XXXXX and v3.5. Select the one with the … Read more

For what reason would I choose a C# compiler file alignment setting other than 512?

That’s a rather technical implementation detail. To get started, you first have to understand the structure of a PE32 file, the file format for DLLs and EXEs in Windows. The canonical article for that is Matt Pietrik’s “Peering Inside the PE, A Tour of the Win32 Portable Executable File Format”. Written 17 years ago but … Read more

Idempotent modifiers in C#

It’s a bug in the compiler – at least in Roslyn version 1.0.0.50618. From section 8.5.2 of the C# 5 specification: A local-constant-declaration declares one or more local constants. local-constant-declaration:    const type constant-declarators constant-declarators:   constant-declarator   constant-declarators , constant-declarator constant-declarator:   identifier = constant-expression As you can see, that grammar doesn’t allow for const const const bool … Read more

Is there a way to get the build command line used by Visual Studio?

When you build a project or solution in Visual Studio, the entire command line used to run the compiler (csc.exe, including switches and parameters) is displayed in the Output window. If you don’t see it there, check the Verbosity level by going to: Options > Projects and Solutions > Build and Run > MSBuild project … Read more

How to get csc.exe path?

c:\Windows\Microsoft.NET\Framework\vX.X.XXX Should contain the latest 32 bit version of csc.exe c:\Windows\Microsoft.NET\Framework64\vX.X.XXX Should contain the lastest 64 bit version of csc.exe That’s what it is for mine anyway. BTW: You can access both by using the Visual Studio Command Line from your visual studio tools folder in your program files. It auto sets up all the … Read more

Is it possible to compile a single C# code file with the .NET Core Roslyn compiler?

Yes, it is possible to compile a single file with csc or vbc compilers in .NET Core. To invoke the Roslyn compiler directly it is necessary to use the command line driver csc.{exe|dll} and since Roslyn in contrast to the old csc.exe does not reference mscorlib.dll implicitly it is necessary to pass a reference to … Read more

Is it possible to install a C# compiler without Visual Studio?

Sure, the framework includes a compiler, csc.exe. Look at this article for a quick how-to. The important parts: You can get the command-line compiler (csc.exe) from Microsoft site http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx. Download the redistributable package of the .NET Framework, which includes the compiler and the .NET Framework with C# 2005 syntax support. The compiler is located in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)