你如何在 Visual Studio 中的项目/解决方案之间共享代码? [英] How do you share code between projects/solutions in Visual Studio?

查看:45
本文介绍了你如何在 Visual Studio 中的项目/解决方案之间共享代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个具有一些通用代码的解决方案,因此我想将其提取出来并在它们之间共享.此外,我希望能够独立发布该库,因为它可能对其他人有用.

I have two solutions which have some common code, so I'd like to extract it out and share it between them. Furthermore, I'd like to be able to release that library independently because it might be useful to others.

  • 使用 Visual Studio 2008 执行此操作的最佳方法是什么?
  • 一个项目是否存在于多个解决方案中?
  • 对于单独的一段代码,我有单独的解决方案吗?
  • 一个解决方案可以依赖另一个解决方案吗?

推荐答案

一个项目可以被多个解决方案引用.

A project can be referenced by multiple solutions.

将您的库或核心代码放入一个项目中,然后在两个解决方案中引用该项目.

Put your library or core code into one project, then reference that project in both solutions.

这篇关于你如何在 Visual Studio 中的项目/解决方案之间共享代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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