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
{{ message }}
Repository navigation
Registering commands with Meta.Load does not unregister them when the plugin is unloaded #254
Registering a command with Pathfinder.Meta.Load.Command will not unregister it when the plugin is unloaded, leading to an error when trying to load the plugin again.
Steps to Reproduce
Create a basic Hacknet plugin.
Create a command, and register it with [Pathfinder.Meta.Load.Command].
Load the plugin as an extension plugin.
Load the extension, then exit it. (You don't need to create an account)
Go back to the extension, and observe the error in the console.
Troubleshooting Attempts
Not much to do, unfortunately. Exiting the game completely fixes this.
Relevant Logs
Log is very messy, so I'll just post the relevant portion:
[Info : BepInEx] 2 plugins to load
[Info : BepInEx] Loading [Stuxnet 2.0.0]
[Info : HarmonyX] ### Harmony id=BepInEx.Plugin.autumnrivers.stuxnet, version=2.5.5.0, location=M:\SteamLibrary\steamapps\common\Hacknet\BepInEx\core\0Harmony.dll, env/clr=4.0.30319.42000, platform=Win32NT, ptrsize:runtime/env=4/Bits64, Windows
### Started from void BepInEx.Hacknet.HacknetPlugin::.ctor(), location M:\SteamLibrary\steamapps\common\Hacknet\BepInEx\core\BepInEx.Hacknet.dll
### At 2025-08-21 11.51.03
[Error : BepInEx] Error loading [Stuxnet 2.0.0]: System.ArgumentException: Command messenger has already been registered!
Parameter name: commandName
at Pathfinder.Command.CommandManager.RegisterCommand(String commandName, Action`2 handler, Boolean addAutocomplete, Boolean caseSensitive) IL<0x0052>
at Pathfinder.Meta.Load.CommandAttribute.CallOn(HacknetPlugin plugin, MemberInfo targettedInfo) IL<0x0031>
at Pathfinder.Meta.Load.AttributeManager.ReadAttributesOnType(HacknetPlugin plugin, Type type) IL<0x008C>
at Pathfinder.Meta.Load.AttributeManager.ReadAttributesFor(HacknetPlugin plugin) IL<0x0046>
at DMD<BepInEx.Hacknet.HacknetChainloader::LoadPlugin>(HacknetChainloader this, PluginInfo pluginInfo, Assembly pluginAssembly) IL<0xFFFFFFFF>
at DMD<BepInEx.Bootstrap.BaseChainloader`1[[BepInEx.Hacknet.HacknetPlugin, BepInEx.Hacknet, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]]::Execute>(BaseChainloader`1 this) IL<0xFFFFFFFF>
[Warning: BepInEx] Skipping [Stuxnet.Audio 0.1.0] because it has a dependency that was not loaded. See previous errors for details.
[Message: BepInEx] Chainloader startup complete
New Game Detected!
Activity
AutumnRivers commentedon Sep 9, 2025
UPDATE: This also seems to happen with Conditions and Actions if there's several being registered with the attribute.
SoundOfScooting commentedon Sep 10, 2025
Actions and conditions aren't using
GetCallingAssembly(), so that would appear to be a different issue.AutumnRivers commentedon Sep 10, 2025
I believe it is a different issue, Actions and Conditionals error out with "An item with that key already exists"