如何从源代码编译C#项目 [英] How to Compile a C# Project from Source

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

问题描述

所以我的意思是编译没有visual studio

So I mean compile without visual studio

推荐答案

此处

编译File.cs生成文件.exe:

Compiles File.cs producing File.exe:

csc File.cs

编译生成File.dll的File.cs:

Compiles File.cs producing File.dll:

csc /target:library File.cs

编译File.cs并创建My.exe:

Compiles File.cs and creates My.exe:

csc /out:My.exe File.cs

编译当前目录中的所有C#文件,并对其进行优化并定义DEBUG符号。输出为File2.exe:

Compiles all the C# files in the current directory, with optimizations on and defines the DEBUG symbol. The output is File2.exe:

csc /define:DEBUG /optimize /out:File2.exe *.cs

这篇关于如何从源代码编译C#项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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