上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: IServiceProvider 处理提供所需服务实例,有需要还会负责释放服务实例。具体操作为调试用实例的dispose或者异步dispose方法。 scoped和transient:当前Iservice provider 对象 调用dispose 方法,实例方法 dispose 也被调用,随之释放 阅读全文
posted @ 2022-10-17 22:19 孤海飞雁 阅读(329) 评论(0) 推荐(0)
摘要: public class ServicesPrpvoder:IServicesPrpvoder 服务提供者可以利用IserviceScoprFactory 创建一个 服务范围 IServiceScope对象IServicesScope 的包含IServicesPrpvoder任何一个 IServic 阅读全文
posted @ 2022-10-17 21:27 孤海飞雁 阅读(61) 评论(0) 推荐(0)
摘要: var sc = new ServiceCollection() .AddScoped<IA, A>() .AddSingleton<IB, B>() .AddTransient<IC, C>() .BuildServiceProvider(true);//ValidateScopes检查在scop 阅读全文
posted @ 2022-10-12 22:00 孤海飞雁 阅读(26) 评论(0) 推荐(0)
摘要: 通过上图可知, 容器中 Transient 的foo 被每个容器创建,scoped 的 ber 也在每个容器中创建 ,二 单例的 baz 只在根容器中创建 阅读全文
posted @ 2022-10-11 21:43 孤海飞雁 阅读(27) 评论(0) 推荐(0)
摘要: 使用ServiceCollection 注入AddTransient,AddScoped,AddSingleton 三不同生命周期的的对象 Transient 最先释放 Scope 随后 Singleton 最后 using (var sc = new ServiceCollection() .Ad 阅读全文
posted @ 2022-10-10 22:10 孤海飞雁 阅读(148) 评论(0) 推荐(0)
摘要: 从官方下载模板Startup Templates - Create a Demo | AspNet Boilerplate 里面前后端,我的时V7.X+NET6+VUE版本的模板 1 打开后端,更换数据库连接,运行可能会报下面这个错误,要建表后运行,不然会报错ABP 什么错误的 可能会报这个错误上图 阅读全文
posted @ 2022-09-24 18:26 孤海飞雁 阅读(237) 评论(0) 推荐(0)
摘要: 重新生成时直接报错,报错项目可直接找到,运行没问题。D:\SourceCode\Net\Runtime2\src\libraries\Common\tests\TestUtilities\TestUtilities.csproj //注释代码 <ItemGroup Condition="'$(Tar 阅读全文
posted @ 2022-09-20 20:07 孤海飞雁 阅读(170) 评论(0) 推荐(0)
摘要: D:\SourceCode\Net\Runtime2\src\libraries\Microsoft.Extensions.DependencyInjection\tests\DI.Tests\Microsoft.Extensions.DependencyInjection.Tests去除里面的Ne 阅读全文
posted @ 2022-09-19 23:21 孤海飞雁 阅读(40) 评论(0) 推荐(0)
摘要: 编译时类似这样 可在D:\SourceCode\Net\Runtime2\NuGet.config 中修改地址就行,途中又注释和新加的 阅读全文
posted @ 2022-09-19 21:32 孤海飞雁 阅读(20) 评论(0) 推荐(0)
摘要: 部分截图 单独编译D:\SourceCode\Net\Runtime2\src\coreclr\build-runtime.cmd 开始删除目录下的CMake的文本文件,没报开始的错误,继续,报错提示生产的log 其实是没生成的,前面编译net7在github上的看到了这个问题,说要修复的,然并卵 阅读全文
posted @ 2022-09-19 21:26 孤海飞雁 阅读(77) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 下一页