gpt4 book ai didi

dll - 使 DLL 保持最新的方法

转载 作者:行者123 更新时间:2023-12-03 18:28:10 24 4
gpt4 key购买 nike

我最近加入了一家公司,该公司多年来为他们提供了许多质量各不相同的开发人员。

已创建的项目依赖于其他项目的输出。
然而,不是以正常方式创建依赖项和维护代码,DLL 已从一个地方复制到另一个地方并从那里引用。

有没有一种简单的方法可以将父文件夹下的所有 DLL 更新到整个文件夹范围内的最新版本(按时间戳)?

所以总结一下流程:

  • 编译所有项目并
    解决方案都在一个根文件夹中。
  • 查找并更新所有其他副本
    输出文件。
  • 重新编译一切并找出
    什么破。
  • 更新源代码并更新
    引用。

  • 问题步骤是2。

    (我很清楚这可能会破坏东西)

    我使用 Visual Studio 2005 和 C# 来创建 DLL,但是我想更新文件而不是代码。

    最佳答案

    Microsoft 最佳实践建议是尽可能引用项目而不是 DLL。

    Project-to-Project References and File References

    File references are direct references to assemblies; you create them using the Browse tab of the Add Reference dialog box. Project-to-project references are references to projects containing assemblies; you create them using the Project tab of the Add Reference dialog box.

    The advantage of a project-to-project reference is that it creates a dependency between the projects in the build system, so the dependent project will be built if it has changed since the last time the referencing project was built. A file reference does not create a build dependency, so it is possible to build the referencing project without building the dependent project, and the reference can become obsolete (that is, the project can reference a previously built version of the project). This can result in several versions of a single DLL being required in the bin directory, which is not possible. When this conflict occurs, you will see a message such as Warning: the dependency 'file' in project 'project' cannot be copied to the run directory because it would overwrite the reference 'file.'.

    You should avoid adding file references to outputs of another project within the same solution, because doing so may cause compilation errors. Instead, use the Projects tab of the Add Reference dialog box to create project-to-project references within the same solution. This makes team development easier by allowing for better management of the class libraries you create in your projects. For more information, see Troubleshooting Broken References and How to: Create and Remove Project Dependencies.



    来自 here .

    关于dll - 使 DLL 保持最新的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/915084/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com