【问题标题】:How to use Glass Mapper 3.3 with Sitecore 7.x and Solr 4.7如何在 Sitecore 7.x 和 Solr 4.7 中使用 Glass Mapper 3.3
【发布时间】:2015-03-03 15:51:24
【问题描述】:

是否有其他人在让 Sitecore 7.x 和 Solr 4.7 与 Glass Mapper 3.3 一起工作时遇到问题? Glass Mapper 似乎使用了 Castle Windsor IOC 容器。 Sitecore 建议也为 Solr 使用 Castle Windsor IOC 容器。

根据 Sitecore,他们告诉我应该使用 Solr 4.7,我应该使用 Castle.core.dll 和 Castle.Windsor.dll 的 3.1 版。但是看起来 Glass Mapper 3.3 需要 Castle.Core.dll 的 3.2+ 版本。

我认为我不是唯一遇到此问题的人。但是我在网上找不到任何关于它的信息。

【问题讨论】:

  • 您是否在应用配置中尝试过绑定重定向?

标签: sitecore castle-windsor solr4 sitecore7 glass-mapper


【解决方案1】:

要详细说明 Phil Degenhardt 的评论,您可以使用 binding redirect configuration 将两个引用解析为同一个程序集。基本上你需要设置一系列指向同一个程序集的版本:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="Castle.Windsor"
                              publicKeyToken="xxxxxxxxxxxxxxx"
                              culture="neutral" />
            <bindingRedirect oldVersion="3.1.0.0 - 3.1.9.0"
                             newVersion="3.2.0.0"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>

您还可以使用probing 让两个程序集版本并排运行,方法是这样设置:

<dependentAssembly>
  <assemblyIdentity name="Castle.Windsor" publicKeyToken="xxxxxxxxxxxxx" /> 
     <codeBase version="3.1.0.0" href="v31/Castle.Windsor.dll"/>
     <codeBase version="3.2.0.0" href="v32/Castle.Windsor.dll"/>
</dependentAssembly>

如果程序集的公共部分发生更改,则第二个选项很有用,在您的情况下重定向可能更有用。

【讨论】:

  • 谢谢。那行得通。我能够重定向到 3.2。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多