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
Loading the plugin with css_plugins load after having unloaded it will throw a looping error "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation."
#99
Closed
DragonHeart000 opened this issue
Nov 18, 2024
· 4 comments
Summary: Loading the plugin with css_plugins load after having unloaded it will throw a looping error "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation."
Version: 0.3.1
Call stack:
08:41:35 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Collections.Generic.KeyNotFoundException: The given key '0' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SharpTimer.SharpTimer.<Load>b__673_1(CCheckTransmitInfoList infoList) in E:\noobclub\poor-sharptimer\src\SharpTimer.cs:line 94
at InvokeStub_CheckTransmit.Invoke(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at CounterStrikeSharp.API.Core.BasePlugin.<>c__DisplayClass51_0`1.<RegisterListener>b__2(ScriptContext context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/BasePlugin.cs:line 298
at InvokeStub_Action`1.Invoke(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at CounterStrikeSharp.API.Core.FunctionReference.<CreateWrappedCallback>b__18_0(fxScriptContext* context)
Repro rate: 5/5
Repro steps:
Launch the server running the latest version of this plugin.
Unload the plugin by running css_plugins unload plugins/SharpTimer/SharpTimer.dll.
Load the plugin back up by running css_plugins load plugins/SharpTimer/SharpTimer.dll.
Notice that the console will be spammed with the above call stack and the plugin will not work.
Note: Attempting to reload the plugin with css_plugins reload plugins/SharpTimer/SharpTimer.dll it will state "Could not reload plugin "plugins/SharpTimer/SharpTimer.dll""
Is there a different or more files that should be reloaded other than SharpTimer.dll? There were a few I tried but none with good results. SharpTimer.dll was at least able to disable the plugin but not reenable it. Alternatively, is there a cvar that enables/disables this plugin? Or is this just not possible with the plugin currently?
Is there a different or more files that should be reloaded other than SharpTimer.dll? There were a few I tried but none with good results. SharpTimer.dll was at least able to disable the plugin but not reenable it. Alternatively, is there a cvar that enables/disables this plugin? Or is this just not possible with the plugin currently?
it's not possible atm, restarting the server is the only solution. it can probably be fixed but I don't think it's a priority right now, also idk why anyone would need to disable & enable the plugin 🫨
I'm trying to find a way to disable and enable the plugin as I am using this server for multiple game modes. Don't want to have to have a timer when I switch the game mode to retakes for example. I was attempting to have different cfgs that would run on a per map basis so when the map changes to another game mode it would enable and disable the proper plugins for it and change any other settings needed.
Appreciate the confirmation on it not being possible currently at least so I don't keep trying to find a way to make it work this way. If it's not a priority for the dev team currently I may look into the issue myself.
Summary: Loading the plugin with
css_plugins load
after having unloaded it will throw a looping error "System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation."Version: 0.3.1
Call stack:
Repro rate: 5/5
Repro steps:
css_plugins unload plugins/SharpTimer/SharpTimer.dll
.css_plugins load plugins/SharpTimer/SharpTimer.dll
.Note: Attempting to reload the plugin with
css_plugins reload plugins/SharpTimer/SharpTimer.dll
it will state "Could not reload plugin "plugins/SharpTimer/SharpTimer.dll""Video: https://github.com/user-attachments/assets/05442c0b-eeb2-4404-acf4-725df0de9dec
The text was updated successfully, but these errors were encountered: