重定向并排组件

问题描述 投票:0回答:1

我正在尝试在我的 .Net 应用程序中使用 SideBySide 程序集。应用程序结构的设置方式是将所有程序集/依赖项放置在链接的子目录中。配置文件使用“probing privatePath=...”引用此目录。是否可以将清单文件或指定的 SideBySide 程序集也移动到该文件夹?

c# .net windows-installer .net-assembly side-by-side
1个回答
0
投票

您可以尝试以下解决方案

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="LinkedSubdirectory"/>
    </assemblyBinding>
</runtime>

此处,该元素指定应用程序应在相对于应用程序基目录的 LinkedSubdirectory 中查找程序集。请记住根据您实际的子目录结构调整配置值。

确保您的应用程序知道新的程序集位置和更新的私有路径配置。这涉及使用适当的探测元素和 privatePath 属性值更新应用程序配置文件(例如 app.config 或 web.config)。

© www.soinside.com 2019 - 2024. All rights reserved.