我的应用程序使用Unity Container v2进行依赖注入。现在我正在使用NUGET包将其迁移到5+,但是我在类解析方面遇到了问题。
var searchClient = IocContainer.Resolve<DocumentSearch>();
给我的提示是:
The non-generic method 'IUnityContainer.Resolve(Type, string, params ResolverOverride[])' cannot be used with type arguments App.Super.Web.App D:\Repo\git1601\App.Super.Web.App\API\ApiControllers\DocumentsController.cs
我已经将从 Microsoft.Practices.Unity
导入的内容改为只有 Unity
,因为软件包发生了变化,但它仍然无法工作。 有任何想法吗?