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

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

问题描述

所以我的意思是在没有 Visual Studio 的情况下编译

So I mean compile without visual studio

推荐答案

来自 这里:

编译 File.cs 生成 File.exe:

Compiles File.cs producing File.exe:

csc File.cs

编译 File.cs 生成 File.dll:

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天全站免登陆