如何在DOS命令行中编译C#代码? [英] how to compile C# code in DOS command line?

查看:115
本文介绍了如何在DOS命令行中编译C#代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在C#中编译一个程序文件,即在命令行中编译为demo.cs,就像这样:在DOS命令行中编译为csc.exe demo.sc.

但是,如果我有很多文件,例如file1.cs,file2.cs,...,file10.cs和file1.cs包含main方法,那么编译包含10个文件的项目的最佳方法是什么?当然,这里以10为例.这个数字可以是n.

欢迎任何链接,网站,博客,论文.

我知道可以使用响应文件,但不确定如何完整.

谢谢一百万.

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.

推荐答案

您已阅读本文;

使用C#2.0命令行编译器 [ ^ ]

如果您使用的是其他版本,则肯定是该文章的较新版本.
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.


关于响应文件,请参见: MSBuild [
About response file, see: @ (C# Compiler Options)[^]

Also, could you use MSBuild[^]


没有这样的想法,例如"DOS命令" OS 中称为"Windows"的行". CMD.EXE特别是常规的Win32或64位应用程序.很久以前,只有在Windows是基于DOS的图形环境时,"DOS"才是这种情况.你去哪了?

另请参见
执行在C#中执行dos命令? [ ^ ].

—SA
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?

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

—SA


这篇关于如何在DOS命令行中编译C#代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆