我如何进口&使用现有的C#类库项目> [英] How I Can Import & Use Existing C# Class Library Project>

查看:54
本文介绍了我如何进口&使用现有的C#类库项目>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我.....

i创建了类库项目,我想导入到windows项目中,以便我可以导入和使用这个类库项目。

pls help me.....
i have created class library project & i wanted to import into windows project so how i can import and use this class library project.

推荐答案

转到要添加库项目的项目的解决方案资源管理器窗口,右键单击它并选择添加引用,然后在打开的窗口中选择浏览并选择物理路径您的库项目检查并添加它。现在您可以使用它。
Go to the solution explorer window of the project where you want to add the library project,right click on it and choose add reference ,then in the opened window choose browse and select the physical path of your library project check it and add it . Now you can use it .


如果您使用的是Visual Studio,请单击Project-> Add Reference ..并选择浏览选项卡。现在在文件浏览器中,选择类库(.dll)的输出文件。现在,您应该能够在类视图中浏览库的类。



注意:如果将类库添加到包含WinForms项目的同一解决方案,而不是转到浏览选项卡,请转到到项目选项卡并选择类库项目名称。
If you are using Visual Studio, click "Project->Add Reference.." and select the tab "Browse". Now in the file browser, select the output file of your Class Library(.dll). Now you should be able to explore the class of your library in "Class View".

Note: If you add the class library to the same solution which contains the WinForms project, instead of going to the browse tab, go to the "Project" tab and select the class library project name.


1)创建主文件夹



2)放两个你的代码在同一个文件夹中(类库项目和窗口应用程序)



3)现在打开窗口应用程序并从新菜单创建解决方案文件并保存在Main文件夹中。



4)右键单击解决方案文件,然后单击添加 - >现有项目 - >转到你的类库文件夹并选择项目文件。



5)一旦项目被添加到解决方案中,你需要添加对你的窗口应用程序的引用。 />


6)现在右键单击您的窗口应用程序并单击添加引用



7)选择解决方案并检查您的课程图书馆项目。并按OK。



8)重建你的解决方案。



9)你可以使用现在的课程和使用C#page顶部的Using语句的类库的对象
1) create main folder

2) put both of your codes in same folder (class library project and window application)

3) now open window application and create solution file from new menu and save in Main folder.

4) right click your solution file and click Add --> Existing Project --> go to your folder of class library and select project file.

5)once project is added to the solution, you need to add reference to your window application.

6)now right click your window application and click Add Reference

7)select solution and check your class library project. and press OK.

8) Rebuild your solution.

9) you can use now class and objects of class library with the use of Using statement at top of the c# page


这篇关于我如何进口&使用现有的C#类库项目>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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