I am trying to locate PerRequestLifetimeManager. In MSDN, it says that it is part of the Unity 3 assembly.
I've installed Unity.Mvc4 via Nuget. The package.config says I am using Unity 3.0:
The Microsoft.Practices.Unity.dll says I am using Unity 3.0
I looked inside the DLL using object browser, and the PerRequestLifetimeManager is no where to be found.
Am I missing something here?
If someone will suggest an alternative class, I am planning to use a custom PerRequestLifetimeManager found here (if I am unable to find the class).
EDIT:
I've uninstalled Unity.Mvc4 and directly installed the Unity3.0 in the package console, here is what I got:
PM> Install-Package Unity -version 3.0.1304.1
'Unity 3.0.1304.1' already installed.
Successfully added 'Unity 3.0.1304.1' to RedLions.Presentation.Web.
I still can't find the PerRequestLifetimeManager class, even in the official library.
It seems not good to answer my own question when I just instead did it on my own. I can no longer delete my question.
Anyway, here was my solution.
I went straight to the source code of Unity, I found out that the class does exist in the same namespace but not in the same assembly. PerRequestLifetimeManager is in Microsoft.Practices.Unity.Mvc
I checked MSDN and it did say that its in a different DLL, which I failed to notice. Sorry about that.
It is not part of the Unity package in nuget, but in a different package in Nuget (Unity.Mvc), so here it is: http://www.nuget.org/packages/Unity.Mvc/
I decided to dump Unity.Mvc4 as it is no longer needed, everything is already in the Unity.Mvc. (App_Start/UnityConfig.cs)
you can delete the original DLLS and Uninstall the reinstall.
Run the following from PCM, Package Manager Console:
Install-Package Unity.Mvc
This will give you the DLL Microsoft.Practices.Unity.Mvc
where it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With