命令行的知识

我们用命令行编译程序的时候,如果程序当中使用了其他的动态链接库,那么就要用/resource命令行开关指定程序中用到的动态链接库,方法如下:
csc /r:thirdparty.dll myapp.cs
可是为何,我们在编译普通程序的时候,不需要用下面的命令来引用.netFramework的动态库?
csc /r:System.dll simpleApp.cs
原因是csc.exe编译器程序使用了一个资源配置文件,该配置文件设置了一些标准的命令行参数,其中包括要引用的默认的DLL文件。这个配置文件是csc.rsp,它与csc.exe位于同一个目录下:
说明:如果系统中安装了Visual Studio.net 2003的话,csc.exe位于C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322目录下
# This file contains command-line options that the C#
# command line compiler (CSC) will process as part
# of every compilation, unless the "/noconfig" option
# is specified.

# Reference the common Framework libraries
/r:Accessibility.dll
/r:Microsoft.Vsa.dll
/r:System.Configuration.Install.dll
/r:System.Data.dll
/r:System.Design.dll
/r:System.DirectoryServices.dll
/r:System.dll
/r:System.Drawing.Design.dll
/r:System.Drawing.dll
/r:System.EnterpriseServices.dll
/r:System.Management.dll
/r:System.Messaging.dll
/r:System.Runtime.Remoting.dll
/r:System.Runtime.Serialization.Formatters.Soap.dll
/r:System.Security.dll
/r:System.ServiceProcess.dll
/r:System.Web.dll
/r:System.Web.Mobile.dll
/r:System.Web.RegularExpressions.dll
/r:System.Web.Services.dll
/r:System.Windows.Forms.Dll
/r:System.XML.dll
用户也可以使用/noconfig命令行开关,让csc.exe编译器不使用csc.rsp配置文件,方法如下:
csc /noconfig /r:System.dll simpleApp.cs

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值