共享模块的项目 [英] Projects sharing a module

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

问题描述

我在自己的项目中有一个实用程序模块,我希望能够在其他项目中使用该模块,如果可能的话,模块的辅助副本中的更改将反映在原始项目中。



我尝试了什么:



复制模块不起作用,因为它变成了一部分接收项目与原始项目无关。

I have a utilities module in it's own project, I want to be able to use that module in other projects such that changes in the secondary copy of the module will be reflected in the original project if possible.

What I have tried:

copying the module doesn't work as it becomes part of the receiving project with no ties to the original.

推荐答案

您可以在不创建新副本的情况下将任何源文件添加到项目中。只是确保它不会被移动或删除并破坏构建。转到Solutions Explorer窗口,右键单击Project name。选择添加 - >菜单弹出窗口中的现有项目,然后导航到要添加的文件。将此模块及其项目作为同一解决方案的一部分可能更有意义。
You can add any source file to a project without creating a new copy. Just make sure it does not get moved or deleted and break the build. Go to the Solutions Explorer window, and right click on the Project name. Select Add -> Existing Item in the menu popup, and navigate to the file that you want to add. It probably makes more sense to make this module and its project part of the same Solution.


将您的实用程序项目编译为类库,并从其他项目中引用它。



建立一个Visual Studio 2017中使用Visual Basic和.NET Core的类库Microsoft Docs [ ^ ]
Compile your utilities project as a class library, and reference it from your other projects.

Building a class library with Visual Basic and .NET Core in Visual Studio 2017 | Microsoft Docs[^]


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

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