.Net 发布商政策:两个程序集都需要加入 GAC 中吗?

发布于 2024-12-09 00:47:06 字数 824 浏览 2 评论 0原文

我按照如何:创建发布商策略。该策略将程序集从版本 1.0.0.0 重定向到版本 2.0.0.0。

只要旧程序集 (v1.0.0.0) 位于服务器上(在 GAC 中),这对我来说就有效。是否可以从服务器中删除旧的程序集版本?

我使用的配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="Assembly.Name"
                           publicKeyToken="d24d3f23b4455982"
                           culture="neutral" />

         <bindingRedirect oldVersion="1.0.0.0"
                          newVersion="2.0.0.0"/>
       </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

I have created a publisher policy assembly following the post How to: Create a Publisher Policy. The policy redirects assemblies from the version 1.0.0.0 to the version 2.0.0.0.

This does work for me as long as the old assembly (v1.0.0.0) is located on the server (in the GAC). Is it possible to remove the old assembly version from the server?

The configuration I used:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
         <assemblyIdentity name="Assembly.Name"
                           publicKeyToken="d24d3f23b4455982"
                           culture="neutral" />

         <bindingRedirect oldVersion="1.0.0.0"
                          newVersion="2.0.0.0"/>
       </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假装不在乎 2024-12-16 00:47:07

我真丢脸。我把汇编版本弄乱了。所以答案是:,它无需旧程序集即可工作。

Shame on me. I did a mess with the assembly versions. So the answer is: Yes, it works without the legacy assembly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文