IUnityContainer.Resolve throws error claiming it cannot be used with type parameters

前端 未结 5 770
陌清茗
陌清茗 2020-12-22 23:46

Yesterday I\'ve implemented the code:

CustomerProductManager productsManager = container.Resolve();

It was co

5条回答
  •  执念已碎
    2020-12-23 00:00

    In my situation the class I was wrapping with Unity inherited from an abstract base class, and that base class did NOT have a parameterless constructor. Once I changed my code to use a parameterless constructor for the base class, the problem disappeared.

提交回复
热议问题