Your solution is exactly how this problem should be solved. And it truly is called a Factory. Yes, things get somehow messy when lots of dependencies are involved.
Some more advanced IoC containers, like Unitylike Unity, can create these kind of factories automagically. Well, according to Unity auto-factory with params , only Autofac can really do that out-of-the box. While Unity can do it, the setup seems to be not much different from defining your own class in terms of amount of code and complexity.