SCANsat icon indicating copy to clipboard operation
SCANsat copied to clipboard

Fix "ADDON BINDER: Cannot resolve assembly" errors in log

Open mwerle opened this issue 4 years ago • 3 comments

Fixes #355 by adding KSPAssembly and KSPAssemblyDependency stanzas to SCANsat and SCANsat.Unity projects respectively.

The latter requires adding a new Assembly Reference to Assembly-CSharp, which then requires fixing up some Namespace issues in the HSVPicker classes.

mwerle avatar Nov 18 '19 10:11 mwerle

NB: This fixes the log errors, but breaks the color picker in-game. It appears it can no longer instantiate the HSVPicker from the prefab (possibly because the namespace has changed; no idea how the prefab is generated or how to update that. From within Unity? Is there an actual Unity project for those?)

mwerle avatar Nov 18 '19 17:11 mwerle

Does this log entry actually affect anything? There have been numerous log warnings like this, either in the player.log (or output log), or sometimes in the Unity profiler log, but as far as I know they never actually do anything.

More importantly, adding the Assembly C Sharp assembly as a reference in the .Unity assembly is not a workable solution, as it prevents the plugin from being loaded by the Unity editor, which would prohibit any work done on the UI and other asset bundles.

DMagic1 avatar Nov 21 '19 05:11 DMagic1

Does this log entry actually affect anything?

I'm not sure; never noticed it prior to 1.8.x so assumed it was a new issue introduced by the change in Unity. I figured part of the mod wasn't (reliably) getting loaded, although SCANsat itself still seems to work ok. I also found an old forum post where a user complained that SCANsat stops working sporadically and this error message was mentioned.

@linuxgurugamer said an alternative way to fix this issue is to ensure that the dependant mod has a higher filename (eg, rename it to "+SCANsat.Unity.dll") to ensure it gets loaded first; not sure if that might cause other issues. Seemed a bit of a hack which is why I investigated the "proper" solution.

as it prevents the plugin from being loaded by the Unity editor

Ahhhh! This might explain why I haven't really been able to figure out how to update SCANsat's Unity projects (or at least, getting them to work properly) with "missing script" everywhere...


So yeah, if referencing Assembly C Sharp breaks the Unity Editor, I guess this approach is a non-starter. Might need to petition Squad to enable assembly dependencies using some other mechanism..

mwerle avatar Nov 21 '19 06:11 mwerle