简体   繁体   English

.Net发布者政策:两个程序集都必须在GAC中吗?

[英].Net Publisher Policy: Both Assemblies required to be in the GAC?

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. 该策略将程序集从版本1.0.0.0重定向到版本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). 只要旧的程序集(v1.0.0.0)位于服务器上(在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>

Shame on me. 真可惜 I did a mess with the assembly versions. 我把程序集版本弄乱了。 So the answer is: Yes , it works without the legacy assembly. 因此答案是: 是的 ,它在没有旧式程序集的情况下可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM