在项目之间共享课程 [英] Sharing classes between projects

查看:80
本文介绍了在项目之间共享课程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MikesStringList类,该类将LoadFromFile和SaveToFile方法添加到List<>.每当我想在新项目中使用它时,我都会将源代码复制到新项目的文件夹中,并使用文本编辑器对其进行编辑,以将命名空间设置为新项目的 命名空间.然后将其添加到项目中.

I have a MikesStringList class which adds LoadFromFile and SaveToFile methods to List<>. Whenever I want to use it in a new project I copy the source into the new project's folder and edit it with a text editor to set the namespace to my new project's namespace. I then add it to the project.

这很繁琐.

要使MikesStringList恰好可用",我该怎么做?像其他本机类一样?

What do I have to do to make MikesStringList "just available" like other native classes?

推荐答案

您要做的是从您要共享的类中创建一个DLL.在您的新项目中,添加对该DLL的引用.很容易.
What you do is create a DLL out of the class you want to share. In your new project, add a reference to the DLL. It's easy-peasy.


这篇关于在项目之间共享课程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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