Could not resolve type name: Glass.Mapper.Sc.Pipelines.Response.GetModel, Glass.Mapper.Sc

岁酱吖の 提交于 2019-12-10 16:56:07

问题


I am trying to use Glass Mapper in my MVC - v4.0.30319 project in Sitecore - 7.1.

Following are my Glass Mapper version which I have installed

  • Glass Mapper version - 3.0.10.23
  • Glass.Mapper.Sc version - 3.2.0.39
  • Glass.Mapper.Sc.Mvc version - 3.2.0.34

when I installed Glass mapper Mvc from nuget it added a config file called (Glass.Mapper.Sc.Mvc) in App_Config -> include folder

Content of the file is as follows

<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>

Now when I run my website, it gives me below error (when running the pipeline mentioned in the above config)

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))

but the reference is already there?

Am I missing any steps? Could someone please help.


回答1:


The developer of Glass Mapper has recently moved some classes to a separate MVC assembly and did not change the config file. The class which could not be loaded is now in the Glass.Mapper.Sc.Mvc assembly, so your config should look like this:

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


来源:https://stackoverflow.com/questions/24299806/could-not-resolve-type-name-glass-mapper-sc-pipelines-response-getmodel-glass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!