asp.net-mvc-4 - 无法解析类型名称 : Glass. Mapper.Sc.Pipelines.Response.GetModel、Glass.Mapper.Sc

标签 asp.net-mvc-4 sitecore sitecore7 glass-mapper sitecore7.1

我试图在我的 MVC - Sitecore - 7.1 中的 v4.0.30319 项目中使用 Glass Mapper。

以下是我安装的 Glass Mapper 版本

  • Glass Mapper 版本 - 3.0.10.23
  • Glass.Mapper.Sc 版本 - 3.2.0.39
  • Glass.Mapper.Sc.Mvc 版本 - 3.2.0.34

  • 当我从 nuget 安装 Glass mapper Mvc 时,它在 App_Config -> 包含文件夹中添加了一个名为 (Glass.Mapper.Sc.Mvc) 的配置文件

    文件内容如下

    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
          <settings></settings>
        <pipelines>
    
    
    
          <mvc.getModel>
            <processor type="Glass.Mapper.Sc.Pipelines.Response.GetModel, Glass.Mapper.Sc"/>
          </mvc.getModel>
    
        </pipelines>
      </sitecore>
    </configuration>
    

    现在当我运行我的网站时,它给了我以下错误(运行上面配置中提到的管道时)

    Could not resolve type name: Glass.Mapper.Sc.Pipelines.Response.GetModel, Glass.Mapper.Sc (method: Sitecore.Configuration.Factory.CreateType(XmlNode configNode, String[] parameters, Boolean assert))



    但引用已经存在?

    我错过了任何步骤吗?有人可以帮忙吗。

    最佳答案

    Glass Mapper 的开发人员最近将一些类移到了单独的 MVC 程序集中,并且没有更改配置文件。无法加载的类现在在 Glass.Mapper.Sc.Mvc 中程序集,因此您的配置应如下所示:

    <mvc.getModel>
        <processor type="Glass.Mapper.Sc.Pipelines.Response.GetModel, Glass.Mapper.Sc.Mvc"/>
    </mvc.getModel>
    

    关于asp.net-mvc-4 - 无法解析类型名称 : Glass. Mapper.Sc.Pipelines.Response.GetModel、Glass.Mapper.Sc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24299806/

    相关文章:

    asp.net-mvc-4 - Web Api Controller 是否应该返回 View 模型

    javascript - AngularJS 发布到 Controller 并重定向到另一个页面

    javascript - 添加没有 "+"符号的数字和字符串

    indexing - Sitecore 7.5 和 Adob​​e IFilter 11 不工作

    asp.net-mvc - Mvc4 捆绑、缩小和 AngularJS 服务

    c# - 如何将动态变量传递给 asp.net mvc 中的授权属性类?

    通过 SAML2 的 Sitecore SSO - AuthenticateRequest 未触发

    sitecore - 清除使用 Glass.Mapper.Sc BeginRenderLink 渲染的 Sitecore 链接字段会删除包装字段

    sitecore - 我可以使用 FullPath 以编程方式转义 Sitecore 查询中的破折号吗?

    xml - Sitecore 7 :Calling one xml control from other xml control