unity ResolutionFailedException 异常

Unity's ResolutionFailedException

我有一个旧的 Asp.Net Web 应用程序使用 Unity 进行依赖注入。 今天我使用 NuGet 将 Unity 更新到最新版本。在尝试 运行 应用程序时,出现异常:

Unity.Exceptions.ResolutionFailedException: '解析依赖失败,type = 'SOME.Services.ISomeService', name = '(none)'. 异常发生在:解决时。 异常是:InvalidOperationException - 类型 DAL.Repositories.SomeRepository 上的 属性 转换器不可设置。

线上发生异常

_someService = container.Resolve<ISomeService>();

我是 Unity 的新手。你能帮忙吗?

较新版本的 Unity 有重大更改。
在重构更改之前,您可能希望坚持使用旧版本的 DLL。

v4.0.1 Version 4.x is dead. Loss of original signing certificate made it impossible to release anything compatible with v4.0.1 release. To give original developers a credit only about 60 issues were found during two years in production. To move on and enable further development version v5 has been created.

v5.x Version 5.x is created as replacement for v4.0.1. Assemblies and namespaces are renamed and refactored but otherwise it is compatible with the original. v5.0.0 release fixes most of the issues found in v4.0.1 and implements several optimizations but the accent was on compatibility and if optimization would break API it was omitted. Once stabilized, this version will enter LTS status and will be patched and fixed for the next few years. There will be no significant development in this line.

查看他们的路线图 here