Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I know how to compile one program file in C#, i.e., demo.cs in command line like this: csc.exe demo.sc in DOS command line.

But, if I have many files such as file1.cs, file2.cs, ..., file10.cs and file1.cs contains main method, what is the best way to compile this project which include 10 files? of course, here 10 is an example. this number can be n.

any link, website, blogs, papers are welcome.

I know reponse file can be used, but not sure how completely.

Thanks a million.
Posted

Have you read this article;

Working with the C# 2.0 Command Line Compiler[^]

There is bound to be a newer version of the article if you are using other versions.
 
Share this answer
 
Comments
Wendelius 17-Dec-11 12:29pm    
Good link, 5'd
Uday P.Singh 17-Dec-11 13:00pm    
5ed :)
About response file, see: @ (C# Compiler Options)[^]

Also, could you use MSBuild[^]
 
Share this answer
 
Comments
Southmountain 17-Dec-11 12:26pm    
no. I do not have MSBUILD and it is now allowed to install.
Wendelius 17-Dec-11 12:28pm    
Ok, then that's not a choice.
Mehdi Gholam 17-Dec-11 12:47pm    
MSBuild comes with the .net installation.
Southmountain 17-Dec-11 15:10pm    
for my 10 separate .cs files I do not have .csproj or .sln file because I manually edit in notepad, is it still possible to compile? do you have a quick tutorial?
Wendelius 17-Dec-11 15:19pm    
Yes, I think one easy way is to build it with *.cs. For example have a look at: http://en.csharp-online.net/CSharp_FAQ%3A_What_is_a_CSharp_response_file[^]
There is not such think as "DOS Command line" in any OS called "Windows". CMD.EXE, in particular, is a regular Win32 or 64-bit application. "DOS" was only the case when Windows was a graphical environment over DOS, long time ago. Where have you been?

[EDIT] See also All ways to execute a dos command in C#?[^].

—SA
 
Share this answer
 
v2
Comments
koolprasad2003 19-Dec-11 0:24am    
Yes. DOS command will work done. 5.
Sergey Alexandrovich Kryukov 19-Dec-11 0:27am    
Thank you, Prasad, but what "yes"? There is no "DOS Command".
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900