我希望我的字段是可编辑的,在sitecore (支持页面编辑器)。我正在使用MVC 4.0和来映射字段。在阅读了MVC页面编辑一篇文章之后,我使用了
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<My Model Class>
若要在部分视图中获取>@Editable,但当我使用inherits关键字时,我的页面将得到以下错误消息
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版本- 3.0.10.23 @Editable关键字来编辑我在Sitecore中的字段。其他版本如下
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
请建议一下。谢谢
发布于 2014-06-20 04:44:09
尝试从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 (假设这是可能的吗?)。
https://stackoverflow.com/questions/24327462
复制相似问题