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
3
votes
1 answer

List of breaking changes in Roslyn

After switching to Visual Studio 2015, we have noticed that some changes made to how lambdas are compiled to MSIL in Roslyn (described in this thread and on GitHub) introduce runtime failures under certain conditions. Since Roslyn is obviously the…
vgru
  • 49,838
  • 16
  • 120
  • 201
3
votes
2 answers

How MSBUILD calls CSC.exe?

I want to know about how msbuild.exe execute a C# application. As i searched in google i came to know csc.exe,PE File, JIT, IL File. And msbuild.exe internally calls csc.exe to compile a C# Application. So I opened csc.exe in reflector. But There is…
Karthikeyan
  • 333
  • 5
  • 17
3
votes
1 answer

XmlSerializer generates invalid temp files and causes csc.exe to fail

My application generates a bunch of serialization assemblies on start up. In this case I am getting an error because the XmlSerializer is failing to generate one of the serialization assemblies. I can go and check the temporary code file being…
carlosearm
  • 31
  • 1
  • 1
3
votes
0 answers

Determine C# compiler version used to compile current program

I'm upgrading a solution from .NET 2.0 to 3.5. One of the projects is a code-generator app that is compiled and then executed via a post-build event. When it is run, it generates some code and invokes csc.exe to compile the generated code. The way…
Amit G
  • 5,165
  • 4
  • 28
  • 29
3
votes
2 answers

#line processor directive in C# increases the line number

The #line processor directive in C# increases the line number for each line to the end of file or until it reaches another #line processor directive; an auto incremental line number. That was interesting! For example: try { #line 110 act(); …
Kaveh Shahbazian
  • 13,088
  • 13
  • 80
  • 139
3
votes
1 answer

How do I run csc against a folder other than the current working directory?

Is there a way to run csc against a folder other than the current working directory, or is the best practice to copy .cs files to the current working directory and then run csc?
Jonathan Beerhalter
  • 7,229
  • 16
  • 68
  • 78
3
votes
1 answer

CodeDomProvider: where is the LIB environment variable located?

I'm using a System.CodeDom.Compiler.CodeDomProvider.CreateProvider("CSharp") to compile C# classes on the fly. Recently I've switched from Visual Studio 2010 to Vistual Studio 2012. I also uninstalled SQL 2005. Since these events I've been unable to…
Kees C. Bakker
  • 32,294
  • 27
  • 115
  • 203
3
votes
3 answers

How to build a .NET website using Nant

I usually use web applications in Visual Studio and the MSBUILD taks in Nant builds them without any problems: arg value="/property:Configuration=release" /> I now have a website (not a web…
Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100
2
votes
4 answers

Does the IL knows what an INTERFACE is?

For example when you introduce an static class in your source code, csc compiler turns it into a sealed abstract class (Correct me if I am wrong, please). But how about Interface; Does the CLR knows what an interface is? Or compiler converts it to…
pencilCake
  • 51,323
  • 85
  • 226
  • 363
2
votes
2 answers

How do I set the flags/switches for the aspnet_compiler in Visual Studio 2010?

I'm having some trouble with namespacing for a web application project - front-end files are being compiled into separate assemblies under the ASPX.directory1_director2_directoryn_filename namespace format and I want everything in one dll. I found…
immutabl
  • 6,857
  • 13
  • 45
  • 76
2
votes
1 answer

Why does the compiler have a problem with this line of code?

The entire solution builds fine in Visual Studio, but when I run the Nant script to compile the website I get several errors on this line: string[] qs = (Request.QueryString["e"] ?? String.Empty) .Split(new[] { '?' },…
Brandon
  • 68,708
  • 30
  • 194
  • 223
2
votes
2 answers

MSBuild reference assembly not being included in build

I can build my project with the following command... csc /reference:lib\Newtonsoft.Json.dll SomeSourceFile.cs ... but when I use this command... msbuild MyProject.csproj ... with the following .csproj file my .dll reference isn't included. Any…
user99874
2
votes
0 answers

Why doesn't my csc.exe compiled code accept a documented String.Split overload?

I'm using an overload of String.Split that the docs says is a valid overload (string, then StringSplitOptions). string separatingString = "<<"; string text = "one<
user32882
  • 5,094
  • 5
  • 43
  • 82
2
votes
0 answers

How to enable compiler warnings for only a region?

I enabled XML documentation generation for my project. true This generates a lot of warnings for my project because I don't compulsively add or update the XML…
Steven Liekens
  • 13,266
  • 8
  • 59
  • 85
2
votes
1 answer

CSC warning CS1668 with Visual Studio 2019

I am compiling a simple hello world .NET Core (net5.0-windows) app with MSBuild.exe. Every time I build, I get the following warnings: CSC : warning CS1668: Invalid search path 'C:\Program Files (x86)\Microsoft Visual…
MHebes
  • 2,290
  • 1
  • 16
  • 29