注册 登录
编程论坛 ASP.NET技术论坛

csc编译问题

lzyren2008 发布于 2008-08-27 11:49, 1613 次点击
在将cs文件编译为dll的过程中遇到如下问题:
csc /t:library /out:mycontrol.dll /r:system.dll system.web.dll mycontrol.cs 显示错误:System.dll与System.Web.dll是二进制文件而非文本文件,未能打开<"未指定的错误“>.
我去掉这两个.dll文件,又显示找不到类型命名空间,请问这是什么问题?
5 回复
#2
yms1232008-08-27 12:09
如果楼主想写C#的组件可以在里建立组建工程不必手动编译源代码。
#3
bygg2008-08-27 12:25
创建 ClassLibrary项目就可以了.
#4
lzyren20082008-08-27 13:56
using System;
using System.Web;
using System.Web.UI;
namespace mycontrols
{
  public class mycontrol:Control
{
protected override void Render(HtmlTextWriter output)
{
output.Write("Hello World!");
}
}
}
谢谢上两位的指教!我采用VS中的classlibrary对上述代码进行编译,出现错误:命名空间"System.Web"中不存在类型或命名空间名称"UI",如用CSC进行编译,csc /t:library /out:mycontrol.dll /r:system.dll system.web.dll mycontrol.cs会出现原来问题,请问这是什么原因了,苦思不得其解,请各位指点!
#5
bygg2008-08-27 15:31
在引用中添加System.Web就好了
#6
lzyren20082008-08-27 16:45
可以了,谢谢,CSC的原因也找到了,是System.web.dll不能用CSC编译,不知为什么?
1