How do I install a C# class library in Visual Studio?

拜拜、爱过 提交于 2019-12-23 09:02:31

问题


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?


回答1:


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).




回答2:


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



来源:https://stackoverflow.com/questions/18586243/how-do-i-install-a-c-sharp-class-library-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!