技术改变世界!学习改变自己!

每天进步一点点,遥不可及的事情,在你一点一滴的努力下,也会变成现实。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

我们用命令行编译程序的时候,如果程序当中使用了其他的动态链接库,那么就要用/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

posted on 2010-03-31 21:15  阿捷  阅读(760)  评论(0编辑  收藏  举报