如何将一个类(.cs)文件编译成.dll文件?
2007-03-12 13:11
489 查看
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/as.Net2.0news/app_code/compon.Nets/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 文档文件
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/as.Net2.0news/app_code/compon.Nets/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 文档文件
相关文章推荐
- 如何将一个类(.cs)文件编译成.dll文件?
- 如何将一个类(.cs)文件编译成.dll文件?
- C#.NET常见问题(FAQ)-如何将cs文件编译成dll文件 exe文件 如何调用dll文件
- C#.NET如何将cs文件编译成dll文件 exe文件 如何调用dll文件
- 用于将.cs文件 编译成dll文件(补充),如何配置在cmd中使用csc命令
- C#一个完整的执行ping命令的.cs文件,可编译成.dll文件用
- C#.NET常见问题(FAQ)-如何将cs文件编译成dll文件 exe文件 如何调用dll文件
- 如何把单个cs文件编译成dll
- 如何把.cs文件编译成DLL文件
- 如何使一个你没有源代码的DLL文件变为强命名的DLL
- 用于将.cs文件 编译成dll文件
- 把CS文件编译成dll文件
- 使用csc命令将.cs文件编译成.dll的过程
- 使用csc命令将.cs文件编译成.dll的过程
- 如何使一个你没有源代码的DLL文件变为强命名的(Strong Name)
- 将cs文件单独编译为dll
- 10.在Xcode中如何以非ARC编译某一个文件
- ROS知识(16)----如何编译时自动链接同一个工作空间的其他包的头文件(包含message,srv,action自动生成的头文件)
- 【转】C#生成dll文件:如何用C#编译生成dll文件即动态链接库文件供其它程序调用
- 如何查看一个jar文件是用什么版本jdk编译的?