将其他课程添加到我的项目中 [英] add other class to my project

查看:67
本文介绍了将其他课程添加到我的项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想从过去(我以前创建的项目)的外部添加一个类(如何在c#2008中工作).

hi all, i want add to my project a class from out side("previous"project) that i create in the past how i can do this i work in c#2008.

推荐答案

只需将文件复制到新的项目源文件夹,然后将其添加到IDE中的项目中.
Just copy the file(s) to your new project source folder, and add them to the project in the IDE.


右键单击所需的项目添加类并选择添加现有项,浏览到文件的位置并选择它.

请确保将名称空间更改为当前名称空间,否则您的类将无法在当前项目中访问.
Right Click on the project you want to add the class and select the option Add existing item,browse to the location of the file and select it.

Please make sure to change the namespace to the current otherwise your class will not be accessible in the current project.


另一种方法是,在编译时,如果您在ClassLibrary中有想要的代码它在bin文件夹中创建一个DLL.将此DLL复制到新项目的相关位置,并在新项目中引用它.
Another way is if you had the code you wanted in a ClassLibrary, when you compile it it creates a DLL in the bin folder. Copy this DLL to a relevant location to your new project and reference it from within your new project.


这篇关于将其他课程添加到我的项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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