Within the SurfaceController class only the default constructor gets called so the dependency resolving never takes place. The YOD says: System.MissingMethodException: No parameterless constructor defined for this object. What is missing here?
Did you have also the problem that the OnApplicationInitialized, OnApplicationStarting & OnApplicationStarted runs twice? If i put a debugger on the project i see two hits on the same code..
MVC v4.10.1 IoC with Unity
Hi,
I am just trying to use dependency injection with Unity base on this docu: https://github.com/umbraco/Umbraco4Docs/blob/master/Documentation/Reference/Mvc/using-ioc.md
Within the SurfaceController class only the default constructor gets called so the dependency resolving never takes place. The YOD says: System.MissingMethodException: No parameterless constructor defined for this object.
What is missing here?
Btw: I have installed the Unity.Mvc3 package and try to register a simple test class with in Unity
This does basically something like documented here http://www.codeproject.com/Articles/118881/Dependency-Injection-in-MVC-3-Was-Made-Easier
and works fine in a plain VStudion MVC3 project.
Yours,
Dirk
I found a solution for my problem. The new way to hook into the application start seems to be implementing the IApplicationEventHandler like so:
Well, its just another example of missing something...
The documentation does work. The only thing I have missed was to chnage the inherits clause / parameter in the global.asax like so:
Did you have also the problem that the OnApplicationInitialized, OnApplicationStarting & OnApplicationStarted runs twice? If i put a debugger on the project i see two hits on the same code..
is working on a reply...