You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Autofac for my discord bot and everything worked fine, until I created my first slash command module.
Failed to create "x.y.Modules.StatusModule", dependency "xyz" was not found.
Discord.NET is trying to resolve the dependency from the IServiceProvider provided to the InteractionService, which is null, since I'm using Autofac.
I tried using property injection instead of the constructor, but with no luck.
Am I "forced" to stick with the built in IServiceProvider for that matter or is there a way to disable this behavior?
I couldn't find anything related to Autofac, ninject or any other custom DI solutions here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using Autofac for my discord bot and everything worked fine, until I created my first slash command module.
Failed to create "x.y.Modules.StatusModule", dependency "xyz" was not found.
Discord.NET is trying to resolve the dependency from the IServiceProvider provided to the InteractionService, which is null, since I'm using Autofac.
I tried using property injection instead of the constructor, but with no luck.
Am I "forced" to stick with the built in IServiceProvider for that matter or is there a way to disable this behavior?
I couldn't find anything related to Autofac, ninject or any other custom DI solutions here.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions