(C#新手)添加参考问题(?) [英] (C# newbie) Adding reference problem(?)

查看:137
本文介绍了(C#新手)添加参考问题(?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!另一个新手问题.

因此,我发现了这个可爱的代码片段,基本上使FolderBrowserDialog(以及其他功能)更加漂亮, http://www.ookii.org /software/dialogs/ [ ^ ],以及我决定使用它.

简而言之,这是我第一次尝试为项目添加新的引用,因此我可能会错过一些显而易见的内容

无论如何,我右键单击解决方案资源管理器中的引用",添加Ookii.Dialogs.dll,然后返回代码并添加使用Ookii.Dialogs;".在顶部的其他参考文献中.
到目前为止一切顺利,没有错误.我什至可以尝试使用它:

Hi! Another newbie question.

So I found this lovely code snippet which basically makes FolderBrowserDialog(among other things) a lot prettier, http://www.ookii.org/software/dialogs/[^], and I decided to use it.

Bare in mind, this is the first time I''ve tried adding a new reference to a project, so I might have missed something obvious

Anyway, I right click on "references" in solution explorer, add Ookii.Dialogs.dll, then I go back to my code and add "using Ookii.Dialogs;" among the other references in the top.
So far so good, no errors. I can even try using it:

using Ookii.Dialogs;

private void button1_Click(object sender, EventArgs e)
{
    TaskDialog td = new TaskDialog();
    td.Show();
}



然后我尝试构建解决方案...
现在它说Ookii.Dialogs不存在,并且我可能缺少参考.

为什么是这样?这是怎么回事?我该如何解决?

非常感谢任何试图帮助我的人!
-Mossmyr



Then I try building the solution...
Now it says Ookii.Dialogs does not exist, and that I might be missing a reference.

Why is this? What''s going on? How can I fix it?

Big thanks to anyone who tries to help me!
- Mossmyr

推荐答案

原因可能是文件Ookii.Dialogs.dll在可执行文件启动所在的文件夹中不可用,因为程序会查找引用的文件如果可执行文件文件夹中的DLLs GAC中不可用.如果以Debug 模式运行,则将文件Ookii.Dialogs.dll复制到项目文件夹下的bin\Debug文件夹,然后添加对该文件的引用.然后构建应用程序.

我认为这可能会有所帮助.
The reason may be that the file Ookii.Dialogs.dll is not available in the folder from where the executable file is started, as the program looks for the referenced DLLs in the executable file folder if they are not available in GAC. If you are running in Debug mode then copy the file Ookii.Dialogs.dll to bin\Debug folder under your project folder, and then add reference to this file. Then build the application.

I think it may be helpful.




实际上,该库不适用于.NET Framework 4.0.您可以通过创建新的Windows窗体应用程序和目标.NET Framework 3.5轻松地对其进行验证.添加对Ookii.Dialogs.dll等的引用,它将正确编译.


Actually the Library does not work with .NET Framework 4.0. You can easily verify it by creating a new Windows Form Application and target .NET Framework 3.5. Add the reference to Ookii.Dialogs.dll, etc... and it will compile correctly.


您需要添加对程序集的引用.右键单击,添加引用"应为您提供此选项,但请确保没有意外添加资源.
You need to add a reference to the assembly. Right click, Add Reference should give you this option, but make sure you haven''t accidentally added a resource instead.


这篇关于(C#新手)添加参考问题(?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆