How can I get the path to a plugin .gha file from within the plugin? Normally, I would do something like Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), but this returns empty string and also, if I try Assembly.GetExecutingAssembly(), all of the paths within point to Grasshopper.dll instead of my .gha file.
Try Assembly.GetAssembly(Type) for one of the types defined in your .GHA (eg. of your implementation of GH_AssemblyInfo).
Assembly.GetAssembly(typeof(*MyPluginAssemblyInfo*)).Location
Alternatively, you can use a component’s Guid to retrieve its source file from ComponentServer.
Grasshopper.Instances.ComponentServer.EmitObjectProxy(ComponentGuid).Location
This did work during debug a few times, but it also returned an empty string. Not sure if this has something to do with developer mode and the way I am loading the assemblies.