8

I am trying to use a class library which I found on a different question here.

I am quite new to C#, Visual Studio, and OOP in general, so please excuse me if this is not the right question.

I followed the link and downloaded the zip. The help file does not seem to contain any directions on how to get Visual Studio to utilize the library. I figure that I have to tell it to use the library somehow, but I really don't know what to do. Or maybe I need to copy the .dll to a specific folder. I also assume I need using ... in the top of the .cs files that use it.

How can I use this library in a Visual Studio C# project?

Community
  • 1
  • 1
user1934286
  • 1,732
  • 3
  • 23
  • 42
  • 1
    you should add that dll into your references folder – Rohit Sep 03 '13 at 07:15
  • All in all you should invest some time learning OOP, visual studio and c# basics. It will be worth! – Luis Filipe Sep 04 '13 at 09:52
  • 1
    @LuisFilipe Yes, I agree. I have been doing school and professional work in Java, JavaScript, C++ and C# for about a year now. I think I got the OOP basics down. I like C# and visual studio the best. It makes the most sense and is/was the easiest to get used to. And the best part is that I don't have to code the gui. – user1934286 Sep 04 '13 at 18:42

2 Answers2

12

You should add a reference.

In the project you are working on, you can add a reference to the dll (or a library) by doing navigating to:

(Project)->References->Add Reference

[You will find Properties, References and [class]files below your project]

According to your question, you should add "UltraID3Lib.dll" to your project references and use it through adding a using on top of your project files like this:

using HundredMilesSoftware.UltraID3Lib;

After you have successfully added the resource you should build the project and it will copy all the necessary files to your output directory (bin/Release or bin/Debug).

user1934286
  • 1,732
  • 3
  • 23
  • 42
  • 2
    Once I add the reference, does it use the file path to the dll or does it copy it somewhere else? Let's say if it was on a thumb drive when I made the reference will it not be able to use it (find it) if I unplug the thumb drive? – user1934286 Sep 03 '13 at 07:24
  • 3
    @fredsbend: On successful adding of a reference, it should be copied to your output directory(say, bin/Release or bin/Debug) when you build your application. – now he who must not be named. Sep 03 '13 at 07:27
  • There are no .dll files in my output directory, though I have successfully added the reference and can use the methods now. I have a bin/Debug directory, but there are no new files in it. – user1934286 Sep 03 '13 at 07:28
  • did you build your application? After successful referencing, you should "build" your application (solution or sln) by going Build->Build Solution. – now he who must not be named. Sep 03 '13 at 07:30
  • Yes, you are right. I saved the solution, but did not build it yet. It added the .dll and the .xml to the Debug directory. Thank you. +1 and selection. – user1934286 Sep 03 '13 at 07:32
1

Step 1:

Open Debug Folder (you can find it In your project Folder => Bin => Debug). Copy .dll >files there.

Step2:

In Solution Explorer Right Click on References => Add References Go to Project Tab. Under the Project Tab you can find Added References (References added In Debug Folder). >Simply select needed references & hit OK. You're done

Happy Coding....! :D

oshan2csd
  • 393
  • 4
  • 11