PuristCoder
PuristCoder
With the internet having developed to this point, there are countless ways to ensure service stability. Yet, they've experienced multiple outages without offering any apologies, compensation, or fixes. I think...
I am using the net core program. This is my configuration information for cap. ` services.AddScoped();` `services.AddCap(x => { x.UseInMemoryStorage(); x.UseInMemoryMessageQueue(); x.UseDashboard(); });`
> Is this issue similar to #1368 ? 其实我是在CapSubscribe里面注入了我项目的其他Service,然后调用其他Service的异步方法的时候发现无法正常使用dbContext。 HttpClient().GetAsync只是我的举例,我上面注释的这段代码运行是正常的,只是放开后下面的dbContext.SaveChangesAsync就会报错。 问题的关键就是我用await执行异步方法之后,我的dbContext就会被disposed掉,不太理解为什么会这样。 并且我刚刚发现,异步方法如果不用await,直接使用.Result获取结果,我的dbContext就不会被disposed
> Is this issue similar to #1368 ? 不用关注了,我找到原因了,我写了一个 public async void 方法····,把void 改为task就不会出现这个问题了
> 你看下不是这个原因#11 谢谢,大概率是的,但是我暂时没时间去验证