问题描述
像大多数商店一样,我们有一个团队从事各种项目,所有这些项目都需要访问与我们业务相关的相同核心信息和功能(通常使用C#)。目前,我们只是在项目之间复制通用的类,但是每个人都开始有自己的风格,我们希望进行整合。
我们使用Tortoise SVN并已维护一个单独的项目以包含我们的通用类,但是不确定将这种通用代码部署到我们的各种应用程序的最佳方法。我们在内部IT商店工作,可以决定用户如何访问应用程序的所有方面,我们不必担心将产品发布到现实世界中。
我们的一些想法是:
- 将类编译为单个DLL并将其加载到全局程序集缓存(GAC)
- 将类编译到单个DLL中,然后将其保存到其他所有项目都将引用的位于中央的共享驱动器中
- 将类编译到单个DLL中,然后将其包含在每个项目中
- 在启动项目时仅获取最新的类,但是没有中央共享库(对此的解释:)
- SVN外部组件
我知道这是一个常见问题,并且如果您花时间研究这些或其他选项,您总是会发现有人在解释每种方法的弊端(版本,回归测试, DLL地狱, GAC很烂等)。我几乎找不到任何人在谈论什么工作以及为什么。有没有首选的方法?
在我公司,我们有同样的问题。当前,我们只使用.bat文件,这些文件会转到SVN Trunk并提取最新的.dll引用,并为您正在处理的项目填充本地References文件夹。
但是,我们目前正在努力将该系统切换到。我不确定100%如何运作,但绝对值得研究。看起来您可以将其设置为可以指向共享代码存储库的位置,然后在Visual Studio中使用插件,就像在每次需要获取最新代码时右键单击并单击更新一样简单。 / p>
Like most shops we've got a team of people working on various projects that all need to access the same core information and functions that relate to our business, usually in C#. We're currently just copying common classes from project to project, but everyone is starting to have their own flavors and we want to consolidate.
We use Tortoise SVN and have decided to maintain a separate project to contain our common classes, but are not sure the best way to deploy this common code to our various applications. We work for an internal IT shop that can dictate everything about how the users access the applications, we don't have to worry about releasing our products into the real world.
Some of our thoughts have been:
- Compile the classes into a single DLL and load it into the Global Assembly Cache (GAC)
- Compile the classes into a single DLL and save it to a centrally located shared drive to be referenced by all other projects
- Compile the classes into a single DLL and include it in each project
- Just fetch the most recent classes when starting a project, but don't have a central shared library (our interpretation of this: http://www.yosefk.com/blog/redundancy-vs-dependencies-which-is-worse.html)
- SVN Externals http://svnbook.red-bean.com/en/1.0/ch07s03.html
I know this is a common problem, and if you spend any time looking into these or other options, you invariably find people explaining the pitfalls of each method (versioning, regression testing, "DLL Hell", "The GAC sucks", etc). I can hardly find anyone talking about what WORKS and why. Is there a preferred method?
At my company we have the same issue. Currently, we just use .bat files that go to our SVN Trunk and pull the most recent .dll references and fill a local References folder for the project you are working on.
However, we are currently working on switching this system over to NuGet. I'm not 100% sure how it works, but it's definitely worth looking into. Looks like you can set it up to where you can point it to a shared code repository, and then in Visual Studio using a plugin, it's as simple as just right clicking and hitting 'Update' everytime you need to get the newest code.
这篇关于使共享库可用于多个应用程序的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!