Questions tagged [csc]

Csc.exe is the command-line compiler for C# from Microsoft.

Csc.exe is the command-line compiler for C# from Microsoft.

301 questions
5
votes
1 answer

Building existing sln fails with Visual Studio 2019

I just upgraded to VS2019 and am unable to build an existing solution. The Compiler generates the following error on some of the projects within the solution: The "DisableSdkPath" parameter is not supported by the "Csc" task. Verify the parameter…
earloc
  • 2,070
  • 12
  • 20
5
votes
4 answers

Compiler command line for C# projects

Visual Studio shows the exact command line use to compiler and link a C++ project under Project Properties -> C/C++ -> Command Line and Linker ->Command Line, but, I was not able to find similar property page for C# projects. Does any know what's…
Faisal Mansoor
  • 2,041
  • 1
  • 21
  • 25
5
votes
4 answers

How to change a c# console application's entry point?

I am wondering whether it is possible to change a .NET console application entry point from Main to Main2 method in the example below: class Program { static void Main(string[] args) { Console.WriteLine("Main"); } …
Artem
  • 2,084
  • 2
  • 21
  • 29
5
votes
1 answer

Does vscode have a csproj generator?

I am using Visual Studio Code because it is more lightweight than Visual Studio but still gives me the intellisense. However I could not find a way for Code to build a .csproj or .sln automatically, so I have been making the files by scratch. There…
PGonzBecer
  • 63
  • 1
  • 7
5
votes
2 answers

String Interpolation inside String Interpolation in C# results in compiler error

The following C# expression is resulting in a compiler error in my program: $"Getting image from {location.IsLatitudeLongitude ? $"{location.Latitude} - {location.Longitude}" : location.Location}." Shouldn't it be possible to use String…
Thomas Gassmann
  • 737
  • 1
  • 13
  • 27
5
votes
1 answer

Do dynamically compiled files use csc.exe in .NET?

Title asked it all, Do dynamically compiled files, such as .cshtml files, use csc.exe in .NET? I saw this question C# JIT compiling and .NET But it doesn't fully go into the compilation of a dynamic file to before being Jit'ed. So you have this site…
Adam
  • 388
  • 1
  • 10
5
votes
2 answers

How to make csc.exe C# 6 aware

I am compiling a basic console app using : C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:myapp.exe Program.cs Which first prints : Microsoft (R) Visual C# Compiler version 4.6.1038.0 for C# 5 Copyright (C) Microsoft Corporation.…
sprocket12
  • 5,368
  • 18
  • 64
  • 133
5
votes
1 answer

What is cvtres.exe?

When I'm using aspnet_compiler.exe to pre-compile my website, I see a cvtres.exe process along with csc.exe. I'm assuming this is part of the .NET compilation process, and would also show when compiling my .NET assemblies. What is cvtres.exe and…
Aaron Jensen
  • 25,861
  • 15
  • 82
  • 91
5
votes
0 answers

"Csc.exe" could not be run. Access is denied (MSB6003)

I just downloaded and installed Xamarin and selected the ASP.NET MVC template. I haven't touched anything. When I build the solution I get the following error: Could not add packages. "The specified task executable "Csc.exe" could not be run.…
Louis
  • 51
  • 4
5
votes
1 answer

Compiling C# manually while targetting .NET 3.5 with Roslyn(csc.exe)

I'm using csc/csc2.exe to manually compile an application. I need to reference .NET 3.5 dlls, however it seems that the compiler automatically adds .NET 4.0 dlls as well (which is causing a conflict). I'm manually referencing the desired version of…
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
5
votes
0 answers

IIS still runs csc.exe after aspnet_compiler has been used to compile application

I've been trying to use aspnet_compiler to pre-compile my asp.net site in order to avoid or minimize running csc.exe after an application pool recycle. However after running the compiler recycling the app pool still causes a tonne of csc.exe…
M4sterShake
  • 140
  • 7
5
votes
1 answer

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…
Frostie
  • 211
  • 3
  • 6
5
votes
1 answer

How to use references when compiling c# code via command line

Could anyone help me compile via command line some c# files? I have 4 files to compile, Main, Form1 (which uses 2.cs file) and another class used in the project. I would like to compile this project in command line so I could add the /t:library…
Iuli
  • 121
  • 1
  • 4
  • 12
4
votes
2 answers

"Proper" way to find path to C# compiler?

Possible Duplicate: C# - How to get csc.exe path? Is there a "proper" way to find the path to the C# compiler on a given system? E.g. for Java, the "proper" way is to use the HKLM\Software\JavaSoft registry key to go through all the different…
user541686
  • 205,094
  • 128
  • 528
  • 886
4
votes
2 answers

How to generate IL source code with csc (C# compiler) or dmcs (mono C# compiler)?

gcc has an option of -s to generate assembly source code. Does csc (MS C# compiler) or dmcs (mono C# compiler) have equivalence? I mean do those compilers provide an option to generate IL source code that can be read not the execution binary?
prosseek
  • 182,215
  • 215
  • 566
  • 871