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
2
votes
0 answers

csc.exe call fails during runtime

When running my C# application i randomly get the following error (currently only on WindowsXP, not reproduceable by us - only at one customer machine)... Cannot execute a program. The command being executed was…
2
votes
4 answers

Command Line Compiler stops working in specific project

I got this strange error saying that the 'Command Line Compiler has stopped working' when I try to build the solution. The solution is 2 projects and a web MVC 4 Application. As I have no idea what it is, I'll depend on your inputs to know what…
Matheus Simon
  • 668
  • 11
  • 34
2
votes
1 answer

Common Language Runtime Detected an Invalid Program with ClickOnce

I have an InvalidProgram exception with the message Common Language Runtime Detected an Invalid Program This happen in an application that we didn't change in the last 3 month. The only change is that we have change our build server (reinstall…
Ido Ran
  • 10,584
  • 17
  • 80
  • 143
2
votes
3 answers

compile error CS0305 Using the generic type List

While csc /t:library strconcat.cs with using System.Collections.Generic; I get an error strconcat.cs(9,17): error CS0305: Using the generic type 'System.Collections.Generic.List' requires '1' type arguments mscorlib.dll: (Location of…
revoua
  • 2,044
  • 1
  • 21
  • 28
2
votes
4 answers

Compile and run the program on the fly

I have a strange requirement, I have been asked to code a certain validation script in VBScript because its in plain text. But I am more comfortable in c#. So is there anyway to schedule it in Task Scheduler such that the compiler will compile the…
Akshay J
  • 5,362
  • 13
  • 68
  • 105
2
votes
1 answer

Setting processor affinity on CSC.exe launched by CoreCompile MSBuild Task

I am wondering if there is simple way to ensure that: when a C# project is compiled, the Csc.exe launched inherits the parent processor affinity settings; or perhaps a way that I can supply this. I have been trying to accomplish this by launching a…
Comic Book Guy
  • 119
  • 2
  • 13
2
votes
1 answer

Visual C# 2010 command line parameters to csc

In Visual C++ 2010, I can see the parameters which are passed to cl.exe: That's very useful because sometimes you forget to check this or that option, add some directory here and there, etc and seeing all the commands at once make this easy to…
zxspectrum
  • 327
  • 1
  • 3
  • 7
1
vote
4 answers

A source compiled with vs2008 produce a binary that is different from the same source compiled directly by csc at command line

I can't understand why If I compile the same source with Visual Studio 2008 (MSBuild) and then with csc (or NANT) at command line I can't obtain exacly the same binary file (the same assembly). The command line is the same that is invoked by visual…
Lorenzo Melato
  • 1,626
  • 1
  • 17
  • 16
1
vote
4 answers

What is the point of command line C# compilation?

I always use Visual Studio to do this, and yet even MSDN repeatedly refers to command line approaches in compilation and deployment scenarios. This guy wants to do only command line, and is lauded for being hardcore, but I fail to see the point of…
Scott Weaver
  • 7,192
  • 2
  • 31
  • 43
1
vote
1 answer

Setting MS C# compiler options via environmental variables?

Is there any way to set default options passed to csc.exe? In particular, I'm interested in supressing copyright messages. For example, for cl.exe and ml.exe I have CL = /nologo ML = /nologo
Egor Tensin
  • 576
  • 4
  • 17
1
vote
2 answers

Running the C# compiler from a C# program

I am trying to build a C# program that converts a different language into C# code. I have the program working fine, converting the code and writing it to a .cs file. I want to have this file automatically be compiled, and run, however I cannot…
mirhagk
  • 1,255
  • 3
  • 14
  • 28
1
vote
2 answers

C# compiler does not find dlls ; solution compiled in VS2010

I have a C# solution and some referenced dll-s. Even though when compiling in visual studio(vs2010) it appears as it succeeded, when using the C# compiler it fails: missing dll apparently.. csc /t:library /out:test.dll test.cs test.cs(22,10):…
agatha
  • 1,513
  • 5
  • 16
  • 28
1
vote
1 answer

VS Code - How can I produce a strongly named assembly?

I have a class library I use for an assembly. It is comprised of three classes - classes A and B provide supporting types and methods for class C. After an assembly is built from that library, I need to register it with the GAC; currently I use…
1
vote
1 answer

Why is my application using CSC during execution

I've been experimenting with the Remotesoft Linker and Mini Deployment tools to create a single native executable (that doesn't need the framework installed) from my managed code. One of the configurable features it has is if csc.exe is available…
1
vote
0 answers

How to get the Intellisense information from csc.exe or msbuild.exe?

As everyone knows, Visual Studio supports the IntelliSense function. But in this article, what I wonder is the principle of the IntelliSense implementation. According to what I know, msbuild.exe is used in Visual Studio to build, and msbuild.exe…
jjw
  • 282
  • 3
  • 20