asp.net .cs文件编译成.dll

1、写好代码先,编译成DLL文件,用C#写的CS文件需要用Framework中的CSC命令编译,编译步骤为:

2、在命令工具中输入 csc /t:library /r:System.Web.dll /r:System.dll /out: 目标文件名 源路径/源文件名。
  csc /target:library /out:e:/cyc/asp.net/words/database.dll e:/cyc/asp.net/words/aspnet2.0news/app_code/componenets/databse.cs

3、为避免每次编译的麻烦,可以建立cmd文件如csd_dl.cmd  ,代码如下:
cd/
d:
cd D:/sys03/microsoft.net/framework/v1.4322
csc  /t:library  /r:System.Web.dll  /r:System.dll /out:E:/web/bin/WebTools.dll e:/web/bin/DbLink.cs
cmd


 -   输出文件   -  
  /out:<file>                           输出文件名(默认值:   包含主类的文件或第一个文件的基名称)  
  /target:exe                           生成控制台可执行文件(默认)   (缩写:   /t:exe)  
  /target:winexe                     生成   Windows   可执行文件   (缩写:   /t:winexe)  
  /target:library                   生成库   (缩写:   /t:library)  
  /target:module                     生成能添加到其他程序集的模块   (缩写:   /t:module)  
  /define:<symbol   list>       定义条件编译符号   (缩写:   /d)  
  /doc:<file>                           要生成的   XML   文档文件   



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1525150

 
发布了5 篇原创文章 · 获赞 0 · 访问量 6万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章