加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 06:33:33 所属栏目:asp.Net 来源:网络整理
导读:我试图在我的MVC中使用Glass Mapper – 在Sitecore – 7.1中的v4.0.30319项目. 以下是我安装的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时,它
我试图在我的MVC中使用Glass Mapper – 在Sitecore – 7.1中的v4.0.30319项目.

以下是我安装的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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读