ObjectDisposedException during bind of remote service
See original GitHub issueWhen I run Bolero.Server (0.12.12-preview32) in debug mode, I’m getting several ObjectDisposedExceptions
at this line, which I can skip and server continues to run normally. I haven’t notice this weird behavior in earlier versions. I’m not 100% sure that it’s not related to my code, but nor it is obvious.
Exception has occurred: CLR/System.ObjectDisposedException An exception of type ‘System.ObjectDisposedException’ occurred in Microsoft.Extensions.DependencyInjection.dll but was not handled in user code: ‘Cannot access a disposed object.’ at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Bolero.Remoting.RemotingExtensions.Remote[T](IProgramComponent this) at Project.Web.Client.Main.MyApp.get_Program() in c:\Project\Web.Client\Main.fs:line 292 at Bolero.ProgramComponent
2.Rerender() at Bolero.Templating.Client.Program.withHotReload@142-1.Invoke(Unit unitVar) at Microsoft.FSharp.Control.CommonExtensions.SubscribeToObservable@1737.System-IObserver
1-OnNext(T args) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1738 at Microsoft.FSharp.Control.FSharpEvent1.Trigger(T arg) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\event.fs:line 127 at Bolero.Templating.Server.Impl.clo@90-3.Invoke(FSharpOption
1 _arg4) at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation1 ctxt, FSharpFunc
2 userCode, b result1) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\async.fs:line 417 at Bolero.Templating.Server.Impl.asyncRetry@42-3.Invoke(AsyncActivation1 ctxt) at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc
2 firstAction) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\async.fs:line 109
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
This looks like a change in the lifetime of some dependencies during prerendering, I’ll look more into it.
Just updated everything to .net 6 and latest bolero and everything works even using paket, so the issue seems to be not actual anymore.