命令行下编译c#程序

bjzhaoxiao 2004-11-04 02:56:20
我的程序是由很多*.cs文件编译而成的一个windows控制台程序,怎样在命令行下编译它?
我用了下面的命令,C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /r:libmySQL-4.0.dll libmySQL.dll MySQLDriverCS.dll SnmpComp.dll /t:exe /out:IPMngr.exe *.cs
系统报

C:\zxf\MyIPMngr\IPMngr>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /r:libmy
SQL-4.0.dll libmySQL.dll MySQLDriverCS.dll SnmpComp.dll /t:exe /out:IPMngr.exe
*.cs
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

error CS2020: Only the first set of input files can build a target other than
'module'
error CS2015: 'c:\zxf\MyIPMngr\IPMngr\libmySQL.dll' is a binary file instead of
a source code file
error CS1504: Source file 'c:\zxf\MyIPMngr\IPMngr\libmySQL.dll' could not be
opened ('未指定的错误 ')
error CS2015: 'c:\zxf\MyIPMngr\IPMngr\MySQLDriverCS.dll' is a binary file
instead of a source code file
error CS1504: Source file 'c:\zxf\MyIPMngr\IPMngr\MySQLDriverCS.dll' could not
be opened ('未指定的错误 ')
error CS2015: 'c:\zxf\MyIPMngr\IPMngr\SnmpComp.dll' is a binary file instead of
a source code file
error CS1504: Source file 'c:\zxf\MyIPMngr\IPMngr\SnmpComp.dll' could not be
opened ('未指定的错误 ')

系统好象说第一个*.cs可编译成*.exe别的不行,请问怎样在命令行下编译由多个cs文件组成的程序.

...全文
457 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Alden 2004-11-04
  • 打赏
  • 举报
回复
UP
trnbo 2004-11-04
  • 打赏
  • 举报
回复
http://www.yesky.com/SoftChannel/72342380468109312/20011030/202721_1.shtml

这篇文章应该能救你。
bjzhaoxiao 2004-11-04
  • 打赏
  • 举报
回复
我在家里是用VS.net开发的,我现在在客户现场,为了调试一个小的错误,我真的必须去装庞大的VS.net吗?请高手救就我吧
bjzhaoxiao 2004-11-04
  • 打赏
  • 举报
回复
又出现了下列问题,怎摸班?
C:\zxf\MyIPMngr\IPMngr>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /r:libmy
SQL-4.0.dll libmySQL.dll MySQLDriverCS.dll SnmpComp.dll /out:IPMngr.exe @mak.mak

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

error CS2015: 'c:\zxf\MyIPMngr\IPMngr\libmySQL.dll' is a binary file instead of
a source code file
error CS1504: Source file 'c:\zxf\MyIPMngr\IPMngr\libmySQL.dll' could not be
opened ('Unspecified error ')
error CS2015: 'c:\zxf\MyIPMngr\IPMngr\MySQLDriverCS.dll' is a binary file
instead of a source code file
error CS1504: Source file 'c:\zxf\MyIPMngr\IPMngr\MySQLDriverCS.dll' could not
be opened ('Unspecified error ')
error CS2015: 'c:\zxf\MyIPMngr\IPMngr\SnmpComp.dll' is a binary file instead of
a source code file
error CS1504: Source file 'c:\zxf\MyIPMngr\IPMngr\SnmpComp.dll' could not be
opened ('Unspecified error ')

C:\zxf\MyIPMngr\IPMngr>
sunyou 2004-11-04
  • 打赏
  • 举报
回复
要引用dot net 程序集才行。libmySQL-4.0.dll libmySQL.dll 好像是MySQL的链接库

另外指定引用文件列表时文件名之间用逗号或分号分隔
csc /r:libmySQL-4.0.dll,libmySQL.dll,MySQLDriverCS.dll,SnmpComp.dll /t:exe /out:IPMngr.exe
wuyi8808 2004-11-04
  • 打赏
  • 举报
回复
C:\zxf\MyIPMngr\IPMngr>dir /b *.cs >mak.mak
C:\zxf\MyIPMngr\IPMngr>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc /r:libmy
SQL-4.0.dll libmySQL.dll MySQLDriverCS.dll SnmpComp.dll /t:exe /out:IPMngr.exe @mak.mak

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧