Kr4ken-9 / NewEssentials

The Essential plugin for Unturned, built on OpenMod
GNU General Public License v3.0
15 stars 13 forks source link

Super Broadcaster Autofac Error #17

Closed Kr4ken-9 closed 4 years ago

Kr4ken-9 commented 4 years ago
[2020-07-16 10:14:51 ERR][OpenMod.Core.Commands.CommandExecutor] Exception occured on command "superbroadcast" by actor player/Vac Efron (76561198079483032)
Autofac.Core.DependencyResolutionException: An exception was thrown while activating λ:NewEssentials.API.Chat.IBroadcastingService -> λ:NewEssentials.API.Chat.IBroadcastingService -> λ:NewEssentials.Chat.BroadcastingService -> NewEssentials.Chat.BroadcastingService. ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'NewEssentials.Chat.BroadcastingService' can be invoked with the available services and parameters:
Cannot resolve parameter 'OpenMod.API.Plugins.IPluginAccessor`1[[NewEssentials.NewEssentials, NewEssentials, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] plugin' of constructor 'Void .ctor(IConfiguration, IPluginAccessor`1)'.
  at Autofac.Core.Activators.Reflection.ReflectionActivator.GetValidConstructorBindings (System.Reflection.ConstructorInfo[] availableConstructors, Autofac.IComponentContext context, System.Collections.Generic.IEnumerable`1[T] parameters) [0x000b3] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance (Autofac.IComponentContext context, System.Collections.Generic.IEnumerable`1[T] parameters) [0x00090] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Resolving.InstanceLookup.CreateInstance (System.Collections.Generic.IEnumerable`1[T] parameters) [0x0002b] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
   --- End of inner exception stack trace ---
  at Autofac.Core.Resolving.InstanceLookup.CreateInstance (System.Collections.Generic.IEnumerable`1[T] parameters) [0x00061] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Resolving.InstanceLookup.Execute () [0x000a7] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance (Autofac.Core.ISharingLifetimeScope currentOperationScope, Autofac.ResolveRequest request) [0x00075] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Resolving.ResolveOperation.ResolveComponent (Autofac.ResolveRequest request) [0x00000] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Resolving.ResolveOperation.Execute (Autofac.ResolveRequest request) [0x00015] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent (Autofac.ResolveRequest request) [0x00033] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.ResolutionExtensions.TryResolveService (Autofac.IComponentContext context, Autofac.Core.Service service, System.Collections.Generic.IEnumerable`1[T] parameters, System.Object& instance) [0x0002d] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.ResolutionExtensions.ResolveOptionalService (Autofac.IComponentContext context, Autofac.Core.Service service, System.Collections.Generic.IEnumerable`1[T] parameters) [0x00030] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.ResolutionExtensions.ResolveOptional (Autofac.IComponentContext context, System.Type serviceType, System.Collections.Generic.IEnumerable`1[T] parameters) [0x00007] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.ResolutionExtensions.ResolveOptional (Autofac.IComponentContext context, System.Type serviceType) [0x00000] in <0e43922c38cb4505ab27fe9ce1207b2d>:0 
  at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetService (System.Type serviceType) [0x00000] in <16a35dbb7431401d8dbe5b3f3333870c>:0 
  at Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorMatcher.CreateInstance (System.IServiceProvider provider) [0x0001c] in <6d11a612ec1e407b9a6674a2353fb9de>:0 
  at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance (System.IServiceProvider provider, System.Type instanceType, System.Object[] parameters) [0x000c3] in <6d11a612ec1e407b9a6674a2353fb9de>:0 
  at OpenMod.Core.Commands.OpenModComponentBoundCommandRegistration.Instantiate (System.IServiceProvider serviceProvider) [0x0001a] in <7c5424964c854b5e8a34fa5e4fb82f2c>:0 
  at OpenMod.Core.Commands.CommandExecutor+<ExecuteAsync>d__6.MoveNext () [0x00331] in <7c5424964c854b5e8a34fa5e4fb82f2c>:0 
Trojaner commented 4 years ago

This is a bug from openmod, apparently it can not find the IPluginAccessor service

archie426 commented 4 years ago

Could try switching it to PluginServiceImplementation

archie426 commented 4 years ago

Possible fix in b493815

Trojaner commented 4 years ago

This will fix it, but I recommend to switch back once the issue is fixed in OpenMod

archie426 commented 4 years ago

Alright

Kr4ken-9 commented 4 years ago

I tested and confirmed it was fixed by that, I will make an issue on OpenMod so it can be appropriately tracked.