1

For a project I'm using Sitecore version 7 and the latest version of GlassMapper. It's an ASP.net MVC3 project. When I try to add a new controller, an error occured:

Microsoft Visual Studio

Could not load file or assembly 'Sitecore.Kernel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Can GlassMapper work with Sitecore version 7.0? Does anyone know how to solve this problem? I don't like it if I need to downgrade to Sitecore version 6.6.

Thanks a lot.

Jordy

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Jordy
  • 661
  • 7
  • 26
  • It works with Sitecore 7, how did you install, using NuGet? – jammykam Jan 16 '14 at 15:18
  • Yes, that's right. I used NuGet for installing GlassMapper. – Jordy Jan 16 '14 at 15:23
  • Did you install version2 (Glass.Sitecore.Mapper) or version 3 (Glass.Mapper.Sc)? – jammykam Jan 16 '14 at 15:29
  • Glass.Mapper.Sc Version 3.1.2.18. – Jordy Jan 16 '14 at 15:32
  • Actually, re-reading your question, I think this is a Sitecore Rocks error. Make sure you are using the latest version – jammykam Jan 16 '14 at 15:37
  • Why do you think that? I did not have any Sitecore Rocks connection. I use the latest version of Sitecore Rocks. – Jordy Jan 16 '14 at 15:42
  • Looks like one of the dependencies is referring to Sitecore 6 in your solution? – xoail Jan 16 '14 at 17:09
  • Jordy were you able to get resolution to your problem? I am having the same problem expect my errors message indicates Glass.Mapper v3.1.7.26. So far this is the only mention of this type of problem that I have found. – mservais Jan 22 '14 at 18:55

1 Answers1

1

It is possible that one of the other assemblies is referencing sitecore 6 dll. You could override it in your configuration to use sitecore 7 like this.

<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Sitecore.Kernel" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="5.0.0.0-6.6.0.0" newVersion="7.1.0.0" />
        </dependentAssembly>
        <dependentAssembly>
</runtime>

hope this helps.

xoail
  • 2,978
  • 5
  • 36
  • 70