Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
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:
C#
using Ookii.Dialogs;

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


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
Posted

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.
 
Share this answer
 
v2
Comments
Mossmyr 3-May-12 12:38pm    
Thanks.
I copied Ookii.Dialogs.dll to the bin\Debug folder, but I get the same error.
"Error, The type or namespace name 'Ookii' could not be found (are you missing a using directive or an assembly reference?)"
(Yes I made sure my solution referred to copied dll, not the original one)
VJ Reddy 3-May-12 12:47pm    
Right click on the project node in the Solution Explorer, select Add Reference menu option, in the opened dialog select Browse Tab page then navigate to the bin\Debug folder and select the Ookii.Dialogs.dll file. Now run the application. I hope it will be helpful.
Mossmyr 3-May-12 12:56pm    
Gives me this error: "The type or namespace name 'Ookii' could not be found (are you missing a using directive or an assembly reference?)"
VJ Reddy 3-May-12 13:07pm    
Please check whether you are running the application in Debug mode. Goto Build->Configuration Manager in the opened dialog select Debug under Active Solution Configuration. Then run the application.
Mossmyr 3-May-12 16:12pm    
Yes, it's in Debug mode
hi,

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.
 
Share this answer
 
Comments
Mossmyr 3-May-12 16:20pm    
Ah! There we go! Thanks man (big thanks to vj reddy for taking his time to help me as well).
If I can bother you some more, how do I convert a project from framework 4.0 to 3.5? (Are there any downsides?)

Edit: Oh yes, how did you know it was incompatible with 4.0?
Bryian Tan 3-May-12 17:50pm    
Actually I downloaded the Library and able to replicate the problem you mentioned here. How big is your project? If you just started, why not start a new one and target the client .NET 3.5 framework?
Mossmyr 3-May-12 18:32pm    
It was quite easy to convert it actually, I think I asked it in the spur of the moment. Right click the project -> Properties -> Select .Net Framework 3.5 in the Target Framework drop-down box.

I also found that it DOES work with .NET Framework 4.0, but not .NET Framework 4.0 Client Profile (whatever the f* that is?). It's listed in the Target Framework drop-down box, try :)
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.
 
Share this answer
 
Comments
Mossmyr 3-May-12 12:54pm    
This is the source of my problem. Adding the reference and building the solution gives me the error
"The type or namespace name 'Ookii' could not be found (are you missing a using directive or an assembly reference?)"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900