0

我在签名的 .NET 程序集地狱中。

我有一个针对签名程序集 A 版本 1.1 ( SA 1.1.1 ) 编译的应用程序。在某些系统上,我已经拥有SA 1.1.2

是否可以在重定向中表达这一点?

SA 1.1.1 binds to SA 1.1.1 OR SA 1.1.2

只是为了提醒你这样的事情是怎样的:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="myAssembly"
                              publicKeyToken="32ab4ba45e0a69a1"
                              culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0"
                             newVersion="2.0.0.0"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>
4

1 回答 1

1

利用

oldVersion="1.0.0.0-2.0.0.0"

注意表示范围的破折号。

对不起,我以为你是反过来的。

我不认为这是可能的。

不过,您可以做几件事。如果您在 GAC 中同时拥有这两个版本,则只需在应用中绑定到您需要的版本即可。即需要绑定到 1.1.1 的应用程序可以指定该版本。需要 1.1.2 的应用可以指定该绑定。否则,我认为最安全的做法是针对所有应用程序针对 1.1.1 或 1.1.2 进行编译。

或者,最后但并非最不重要的一点是,取消签名并针对未签名版本进行编译,然后该版本将获取具有您指定的“友好”名称的任何程序集。

于 2011-03-08T09:32:39.243 回答