.NET Core 3.0中AspectCore如何实现创新编程模式?
- 内容介绍
- 文章标签
- 相关推荐
本文共计595个文字,预计阅读时间需要3分钟。
前言:这几天在对EasyCaching做支持.net core 3.0的调整,期间遇到了下面这个错误。
System.NotSupportedException: ConfigureServices returning an System.IServiceProvider isn't supported 针对这个问题,网上能找到的答案如下:
前言
这几天在对EasyCaching做支持.net core 3.0的调整。期间遇到下面这个错误。
System.NotSupportedException:“ConfigureServices returning an System.IServiceProvider isn‘t supported
针对这个问题,网上能找到比较多的资料是关于Autofac的,AspectCore的好像比较少。
下面就直接看看简单的处理方法,也在AspectCore上面的Issue回复了。
ServiceProviderFactory的使用
在preview3之后,ConfigureServices方法就不支持直接返回System.IServiceProvider。
我们可以通过IHostBuilder 的 UseServiceProviderFactory方法来覆盖默认的工厂实现。
本文共计595个文字,预计阅读时间需要3分钟。
前言:这几天在对EasyCaching做支持.net core 3.0的调整,期间遇到了下面这个错误。
System.NotSupportedException: ConfigureServices returning an System.IServiceProvider isn't supported 针对这个问题,网上能找到的答案如下:
前言
这几天在对EasyCaching做支持.net core 3.0的调整。期间遇到下面这个错误。
System.NotSupportedException:“ConfigureServices returning an System.IServiceProvider isn‘t supported
针对这个问题,网上能找到比较多的资料是关于Autofac的,AspectCore的好像比较少。
下面就直接看看简单的处理方法,也在AspectCore上面的Issue回复了。
ServiceProviderFactory的使用
在preview3之后,ConfigureServices方法就不支持直接返回System.IServiceProvider。
我们可以通过IHostBuilder 的 UseServiceProviderFactory方法来覆盖默认的工厂实现。

