c# - Unity Container exception – You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime
问题描述
I've got a project that I need to Migrate from .NET Framework to .NET Core. After migrating it I've noticed an exception –</p>
Unity.Exceptions.ResolutionFailedException HResult=0x80131500
Message=Resolution of the dependency failed, type = 'LanDocs.ExchangeSystem.Server.Interfaces.IExchangeDataHandler', name = '(none)'. Exception occurred while: while resolving. Exception is: InvalidOperationException - You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime.
What might be the issue and how to fix it?
解决方案
I've figured it out myself and decided to share the solution here since I haven't found anything helpful while struggling with it. The issue was with Policy Injection – once I've removed the entire section everything worked well. But the problem was the version of version of nuget package. I've had Unity.Interception with version 5.5.3 and Unity with version 5.8.6. Once I've changed both versions to 5.11.1 everything worked well on .NET Core.
推荐阅读
- javascript - 返回声明不等待
- ios - 如何让所有 UICollectionViewCells 共享相同的高度?
- visual-studio-code - 如何将我的结果从 Visual Studio 代码导出到我的计算机上的文件
- sql-server - 如何使用 Log Analytics 在 Azure 中获取 SQL 数据库状态
- python - 如何解释集群?
- accessibility - 添加到购物车电子商务体验的最佳 Web 可访问性选项是什么?
- angular - PrimeNG 错误 ConfirmationService 没有被 ngcc 正确处理,或者与 Angular Ivy 不兼容
- python - 关于 LSTM 模型中输入形状的困惑
- laravel - Laravel 在表格中显示带有 parent_id 的嵌套类别
- docker - 在 Traefik 后面运行 Nginx,端口不是 80 的问题