Caves of Qud

Caves of Qud

Harmony Injector
HawkleyFox  [developer] 19 Mar, 2019 @ 8:31pm
Better Ability Bar + Hover Info = Error
A user has been having issues trying to get both Better Ability Bar and Hover Info working together. Check out this discussion for a little more context.

It seems that when both are installed, the following error occurs. I was able to reproduce it myself.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CompiledMods, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'CompiledMods, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' at System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, Boolean refonly) [0x00000] in <filename unknown>:0 at System.AppDomain.Load (System.String assemblyString) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) System.AppDomain:Load (string) at System.Reflection.Assembly.Load (System.String assemblyString) [0x00000] in <filename unknown>:0 at System.Reflection.MemberInfoSerializationHolder..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext ctx) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <filename unknown>:0 at Harmony.PatchInfoSerialization.Deserialize (System.Byte[] bytes) [0x00000] in <filename unknown>:0 at Harmony.HarmonySharedState.GetPatchInfo (System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0 at Harmony.PatchProcessor.Patch () [0x00000] in <filename unknown>:0 at Harmony.HarmonyInstance.Patch (System.Reflection.MethodBase original, Harmony.HarmonyMethod prefix, Harmony.HarmonyMethod postfix, Harmony.HarmonyMethod transpiler) [0x00000] in <filename unknown>:0 at HarmonyShim.Harmony.Patch (System.Reflection.MethodBase original, System.Reflection.MethodInfo prefix, System.Reflection.MethodInfo postfix, System.Reflection.MethodInfo transpiler) [0x00000] in <filename unknown>:0 at HawkSoft.BetterAbilityBar.Init..cctor () [0x00000] in <filename unknown>:0

Although the error is triggered by Better Ability Bar patching the methods it uses via the `HarmonyShim` API, the source of the problem seems to be really deep in Harmony. I'm concerned that the current `HarmonyShim` API may be putting Harmony into a bad state when used along-side mods that use the attribute-based patching methods.

I'm certainly using the API correctly. I should know, I technically authored it. xP

Do you have any insight into the nature of this issue? Can you reproduce it yourself?
Last edited by HawkleyFox; 19 Mar, 2019 @ 8:31pm
< >
Showing 1-3 of 3 comments
HawkleyFox  [developer] 19 Mar, 2019 @ 8:33pm 
Oh, also, I should note that I wasn't able to get Hover Info to work at all. When installed on its own, without Better Ability Bar, it doesn't appear to do what it is advertised to do... But it also raises no errors either.

It may be that this is an issue local to me, though. Tyrant suggests it works for him, so... I dunno!
namkazt  [developer] 31 Mar, 2019 @ 10:11pm 
@HawkleyFox: thanks for information, hover info currently broken.
namkazt  [developer] 1 Apr, 2019 @ 4:51am 
i will take sometime to check this issue
< >
Showing 1-3 of 3 comments
Per page: 1530 50