如何强制 VS 2008 部署项目在两个不同的位置安装同一文件的两个不同版本?
一些背景: 我有一个 VS 2008 部署项目,我没有使用项目输出,我直接添加程序集文件,因为我们有第三方许可和混淆工具,我们在构建程序集后在程序集上运行它们。此部署项目中还包含一个带有示例的帮助目录。
示例之一是一个 C# 项目,它引用主程序中的一些程序集。我们为此示例项目包含 bin\Release 文件夹,以便最终用户可以轻松运行该示例,而无需通过调试器或任何其他方式运行该示例。这可能具有旧版本的主项目程序集,因为这取决于示例项目上次构建的时间。
问题: 示例项目引用的主要项目程序集包含在示例的 bin\Release 文件夹中,部署项目中的应用程序目录中包含同名但版本不同的程序集。 VS 2008 似乎试图通过识别这些文件具有相同的名称来最小化空间,因此它存储一个副本。但是,它使用示例中的文件而不是主项目中的文件。有没有办法告诉 VS 每次都使用指定的文件,即使可能存在另一个同名文件?
Some Background:
I have a VS 2008 Deployment project I am not using the project output, I am adding assembly files directly because we have third party licensing and obfuscation tools that we run on the assemblies after building them. Also included in this deployment project is a Help directory with examples.
One of the Examples is a C# project that references some of the assemblies from the main program. We include the bin\Release folder for this example project so that an end user can easily run the example with out having to run the example through a debugger or anything. This may have older versions of the main project assemblies because this will depend on when the Example project was last built.
The issue:
The main project assemblies referenced by the example project are included in the bin\Release folder for the example, and an assembly with the same name but different version is in the Application Directory in the deployment project. It seems that VS 2008 is trying to minimize space by recognizing that these files have the same names so it stores one copy. However it is using the file from the example not the file from the main project. Is there a way to tell VS to use the specified file every time even if there may be another file with the same name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,当您将程序集添加到部署项目时,VS 会自动添加其依赖项。但是,在重建时,这些依赖项永远不会更新(它将始终使用与您首次添加需要这些依赖项的程序集时相同的版本)。
我必须排除依赖项(因为 VS 不会让你删除它们)并手动添加这些相同的文件。现在,每次我进行构建时,我都会获得这些文件的最新版本。
So it turns out when you add an assembly to a deployment project VS automatically adds its dependencies. However, when rebuilding those dependencies never get updated (it will always use the same version as when you first added the assembly that required those dependencies).
I had to exclude the dependencies (as VS will not let you delete them) and manually add those same files. Now every time I make a build I get the latest version of those files.