3

I'm using Unity Dependency Injection in my project and when upgrading to new ASP.NET MVC5 make a problem of "Entry point was not found" what happened to DependencyResolver and how can I fix this?

5
  • 3
    Can you provide more details? I'm using Unity 3 along with Unity bootstrapper for ASP.NET MVC. My code DependencyResolver.SetResolver(new UnityDependencyResolver(container)); works OK. Commented Nov 6, 2013 at 5:32
  • can you upgrade it to mvc5 and razor3 without problem ? Commented Nov 6, 2013 at 5:37
  • Yes, I upgraded following How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2. Perhaps there is an issue with the specific bootstrapper used to integrate Unity with MVC (e.g. Unity.Mvc4 if you are using that...you didn't mention)? Commented Nov 6, 2013 at 5:52
  • Its not just Unity. I'm running into the same issue with Autofac. Commented Nov 26, 2013 at 5:24
  • 1
    Switching from my custom unity dependency resolver class to the one that comes out of the unity box solved my issue. Big thanks @Tuzo for pointing me in the right direction. Commented Feb 27, 2014 at 18:02

2 Answers 2

2

Like Tuzo said, try upgrading our Unit MVC bootstrapper to the version that supports MVC5.

http://www.nuget.org/packages/Unity.Mvc5/

Sign up to request clarification or add additional context in comments.

1 Comment

We're actually using Autofac instead of Unity but I'm getting the exact error as mentioned above. Updating the DI package solved this issue for me.
0

Check the version of System.Web.WebPages.Razor, update it to latest version.

Try Unity with Unity.Mvc5 1.1.0 nuget package. You can find a step-by-step guide below. MVC 5 with Unity for Dependency Injection

1 Comment

Package appears to be broken and has not been updated in a while

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.