Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sitecore 9.1.0 upgrade issue with Simple Injector DI #721

Open
SharathMP opened this issue Jun 4, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@SharathMP
Copy link

commented Jun 4, 2019

I am currently(after upgrade) on System.web.mvc version->5.2.6
Simple Injector Version -> 2.8.0
Glass Mapper -> 5.4.21
Sitecore ->8.1.2
I have upgraded Glass mapper to 5.4.21 and Also MVC to 5.2.6 but now my Simple Injector DI is giving issues that->

Method 'get_SitecoreService' in type 'KC.WEM.PLAT.SCExtensions.Glass.Mapper.Sc.Helpers.WEMGlassHtml' from assembly 'KC.WEM.PLAT.SCExtensions, Version=8.1.3.3, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Can you please suggest any inputs?

@dotnetjunkie

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2019

We will need much more information to be able to help you. You can start with posting the full stack trace (including all inner exception details)

@dotnetjunkie

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2019

Next time, please make use of our question templates. It contains guidance on how to post a great question.

@SharathMP

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

Hi Team,
I was trying to dig deeper into the Issue with Simple Injector DI.

Well, I am in the process of migrating from Sitecore 8.1 to 9.1.0, I have done the glass mapper migration to V5 using Glass.mapper.sc.91 nuget which installs the Castle core DI by default.

Current Situation: In my 8.1 Code base (solution) we have used Simple Injector DI. Now when i did the migration of glass mapper V4 to V5, It automatically upgrades/Installs the Castle core 4.4.0 (my current version was 3.3.0).

When you migrate to V5 of Glass Mapper it adds a GlassMapper.cs and GlassMapperscCustom.cs files to App_start folder.
GlassMapperScCustom.cs is unchanged in V5 but GlassMapper.cs is like Completely Revamped in V5.

Problem Statement-->
GlassMapper.cs class inherits class - Glass.Mapper.Sc.Pipelines.Initialize.GlassMapperSc and overrides lot of methods.
So i can see drastic changes of GlassMapper.cs class from V4 to V5.

The build was successful but when i debug i am getting an error in CreateResolver method of IDependencyResolver function.
NullReferenceException: Object reference not set to an instance of an object

    public override IDependencyResolver CreateResolver()
    {
        var resolver = GlassMapperScCustom.CreateResolver();
        base.CreateResolver(resolver);
        return resolver;
    }

Attached is the snapshot of the exception, Please help

G M V5Error

@dotnetjunkie

This comment has been minimized.

Copy link
Collaborator

commented Jun 12, 2019

Thank you for this detailed report. Unfortunately, I'm unfamiliar with Sitecore, let alone GlassMapper, let alone changes from v4 to v5. The exception runs deep inside GlassMapper, so you mifht want to open their source code to see what causes the null ref.

@SharathMP

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

Any Idea on Simple Injector and Sitecore Version Compatilities?
currently I am on SI 2.8.0. If i upgrade to 4.6.0- What are the changes in the latest version of SI compared to 2.8.0 on high level?

@dotnetjunkie

This comment has been minimized.

Copy link
Collaborator

commented Jun 12, 2019

What are the changes in the latest version of SI compared to 2.8.0 on high level?

Wow... quite a lot actually... I can't give you a list from memory, but you should start by looking at the major changes in the major releases v3.0 and v4.0:

Please also note the warning in the release notes:

Before you upgrade to v3.0, please make sure you upgrade your application to the latest 2.8 version of Simple Injector first.
Before you upgrade to v4.0, please make sure you upgrade your application to the latest 3.x version of Simple Injector first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.