csc选项

C:\Users\zjh>cd C:\Users\zjh\source\repos\For study

C:\Users\zjh\source\repos\For study>csc /t:library acme.cs
Microsoft (R) Visual C# Compiler version 4.7.2053.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240


C:\Users\zjh\source\repos\For study>csc /r:acme.dll example.cs
Microsoft (R) Visual C# Compiler version 4.7.2053.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240


C:\Users\zjh\source\repos\For study>example
100
10

1

能运行了

C#编译器选项全解

 可以使用CSC.exe/?来察看可选项.
输出文件相关选项 :
/out:<file>      输出文件名(如果不指定则从第一个源文件名中取得)
/target:exe     建立一个控制台可执行程序(这是默认选项)(可以缩略写作 /t:exe)
/target:winexe   建立一个windows可执行程序(可以缩略写作 /t:winexe)
/target:library    建立一个库(可以缩略写作 /t:library)
/target:module    建立一个可以加到其他汇编文件的模块(可以缩略写 作 /t:module)
/win32icon:<file> 指定一个图标作为输出文件的图标
/nooutput[+|-]   只检查代码中的错误,并不生成可执行程序
/define:<symbol file>    定义条件编译符号(可以缩略写作 /d)
/doc:<file>        生成XML文档
 
输入文件相关选项:
/recures:<wildcard>   包括当前目录及其子目录下所有符合指定的通配符规则的文件
/main:<type>   指定包含入口点的类型(忽略其他所有可能的入口点)(可以缩略写作 /m)
/reference:<file list>    参考由给出的汇编文件所指定的元数据(可以缩略写作 /r)
/addmodule:<file list> 链接指定的模块到汇编文件中
 
资源相关选项 :
/resource:<resinfo>      嵌入特定的资源(可以缩略写作 /res)
/linkresource:<resinfo>     链接指定的资源到汇编文件中(可以缩略写作 /linkers)
 
代码生成相关选项
/debug[+|-]         产生调试信息
/optimize[+|-]        提供优化(可以缩略写作 /o)
/incremental[+|-]       进行增量编译,也就是只编译改变的部分(可以缩略写作 /incr)
 
错误和警告相关选项
/warnaserror[+|-]       对警告与错误作相同处理
/warn:<n>          设定警告级别(0-4)(可以缩略写作 /w)
/nowarn:<warning list>    禁止特定的警告消息
 
语言相关选项
/checked[+|-]         对上溢和下溢进行检查
/unsafe[+|-]         允许"不安全"的代码
 
其他方面的选项
@<file>           读取相应文件以获取更多选项
/help             显示帮助文件(可以缩略写作 /?)
/nologo            禁止编译版权信息
 
u       增强的选项
/baseaddress:<address>    指定被编译库的基地址
/win32res:<file>        通常用来指定存放版本和图标信息的WIN32资源文件
/bugreport:<file>       建立"错误报告"文件
/codepage:<n>         指定打开源文件时使用的代码页
/fullpath           指定程序生成的完整路径
/nostdlib[+|-]        不参考标准库(mscorlib.dll)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值