求教一个c#小问题

forestwind 2008-11-18 09:37:14
小弟最近在用dotmsn, 自己也用人家的框架写点程序,考了人家一段代码,一跑这里总出问题,哪位大侠好心给解决一下,感激不尽

private delegate ConversationForm CreateConversationDelegate(Conversation conversation);

private ConversationForm CreateConversationForm(Conversation conversation)
{
// create a new conversation. However do not show the window untill a message is received.
// for example, a conversation will be created when the remote client sends wants to send
// you a file. You don't want to show the conversation form in that case.
ConversationForm conversationForm = new ConversationForm(conversation);

// do this to create the window handle. Otherwise we are not able to call Invoke() on the
// conversation form later.
conversationForm.Handle.ToInt32();

return conversationForm;
}

Error 1 The type or namespace name 'ConversationForm' could not be found (are you missing a using directive or an assembly reference?) D:\C_lang\msnrobot\msnrobot\robot.cs 161 26 msnrobot

我仔细核对了所有的using我都加上了,而且应该reference的地方也加上了,可是死活就抱这个错。
...全文
105 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
有这种可能,你引用的第三方的dll本身引用了其他dll,你没有把它加进来,也会报这个错误,就是说你使用的这个类其实不在你引用的dll里,在你的引用的dll依赖的另外一个dll里。
forestwind 2008-11-18
  • 打赏
  • 举报
回复
我的楼主,我刚刚试了删除reference再重加,然后再rebuild,可是还是不行啊,这个ConversationForm 确实引用了第三方,可是我的确添加了
spmzfz 2008-11-18
  • 打赏
  • 举报
回复
错误:类型OR命名空间'ConversationForm' 没有发现。。。。

所有的using我都加上了,而且应该reference的地方也加上了

我不知道你是如何处理的,如果是只加上代码using等当然会出错了,你要通过操作Using后才能写上using代码
等的。
cpio 2008-11-18
  • 打赏
  • 举报
回复
不光是要添加using,还得在项目里面添加引用

选择项目菜单=>引用,打开的窗口中选择浏览,找到那个文件,确定。
bloodish 2008-11-18
  • 打赏
  • 举报
回复
Clear Solution
Rebuild Solution
ReAdd Reference
jietuan 2008-11-18
  • 打赏
  • 举报
回复
ConversationForm 你引用了第三方的dll,你要在reference 添加引用
xiaoqhuang 2008-11-18
  • 打赏
  • 举报
回复
ConversationForm这个是什么? 可能少引用了某个第三方的.dll

110,534

社区成员

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

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

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