0

自分のフィールドを Sitecore で編集できるようにしたい (ページ エディターをサポート)。MVC 4.0 と Glass Mapper を使用してフィールドをマッピングしています。記事Page Editing in MVCを読んだ後、私は使用しました

 @inherits Glass.Mapper.Sc.Web.Mvc.GlassView<My Model Class>

部分ビューで >@Editable を取得しますが、継承キーワードを使用すると、ページがエラー メッセージの下に表示されます

Error: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference

MVC 4.0 および Glass Mapper バージョン - 3.0.10.23 で Sitecore のフィールドを編集する @Editable キーワードの方法を提案してください。他のバージョンは

Glass.Mapper.Sc バージョン - 3.2.0.39

Glass.Mapper.Sc.Mvc バージョン - 3.2.0.34

私のビューは以下のようになります

@using Sitecore.Mvc
@using Test.Libraries.Sitecore.Glass.Mapper.Common;
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<Test.Libraries.Sitecore.Glass.Mapper.Common.Footer>

   <h2>@Editable(x=>x.Title)</h2>

 View which works is

@using Sitecore.Mvc
@using Test.Libraries.Sitecore.Glass.Mapper.Common;
@model Footer

   @Model.PageTitle

提案してください。ありがとう

4

1 に答える 1

1

MVC 3 -> MVC 4 からバインディング リダイレクトを追加してみてください...

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers"
             publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc"
             publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages"
             publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Web プロジェクトの web.config に追加します (sitecore で可能だと仮定しますか?)。

于 2014-06-20T12:44:09.243 に答える