Plugin Developer Discussion

Discussion for FogBugz Plugin developers

External Assemblies for Plugins - don't always work

So I've been working on some plugins and I've found that sometimes external assemblies work and other times they don't. I can't for the life of me figure out why. I've currently got an external assembly linked from a second project file. This will not load. I keep getting a plugin load failure System.IO.FileNotFoundException: Could not load file or assembly. Yet it exists in the plugin cache dir. What am i missing here? It's a simple external assembly that only references system and system.core.
tracstarr Send private email
Saturday, December 12, 2009
 
 
Hi Tracstarr-
These can be really frustrating, as the error is (as you have seen) pretty opaque. If it's not obvious, try turning on Fusion logging: http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx
Does that help?
Thanks!
Brett
Brett Kiefer Send private email
Saturday, December 12, 2009
 
 
I gave up before reading this. But i do want to move code back into a separate assembly, so i will have to try this method when I get a chance.

Thanks
tracstarr Send private email
Sunday, December 13, 2009
 
 
well the logs give me the following. Googling pointed me towards an issue with indexing service, but I have it turned off. Perhaps you've seen this before?

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
tracstarr Send private email
Sunday, December 13, 2009
 
 
Hi Tracstarr-
If the assembly is present in the same plugin subdir as the plugin .dll, is strongly-named, is showing up in the plugin cache dir, and is referenced properly, then my first guess would be that the IIS website app pool owner's permissions might not be correct.
Let's try an experiment -- are you running FogBugz 7.1.5? If so, can you see what happens when you build Plugins/examples/CustomFields and allow it to upload to your test site? A fresh build of this will try to include the new FogCreek.Plugins.BugField .dll with the plugin, so if that works, then we can narrow down our field of search to how your second .dll is referenced.
Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 
No, i'm only running 7.0.34 - which says it's up to date when i run the update check.

Now one thing i didn't do was sign my assemblies with a strong name - I will have to try that. Didn't even cross my mind.
tracstarr Send private email
Monday, December 14, 2009
 
 
Signing both my plugin and referenced assembly results in the same issue.
tracstarr Send private email
Monday, December 14, 2009
 
 
Tried to build that CustomField example but it complains. Wasabi was unexpected at this time. Don't know anything about wasabi myself, so I couldn't even try to tackle that one.
tracstarr Send private email
Monday, December 14, 2009
 
 
So, i reverted back to using only the single dll, but left the code signing/strong name... and it complained about loading. Remove it, and it was fine.
tracstarr Send private email
Monday, December 14, 2009
 
 
Hi Tracstarr-
Did you also add the AllowPartiallyTrustedCallers attribute? You'll need that when you strong-name it. What was the error?
Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 
well, adding that attribute allows the main plugin dll to load fine. However, if i then try to reference the external assembly, signed with or without that attribute, it still doesn't load.

=== Pre-bind state information ===
LOG: User = WIN2K8\FogBugz
LOG: DisplayName = BBPlugins.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aaf7db694a6a50c1
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/FogBugz/website/
LOG: Initial PrivatePath = C:\Program Files (x86)\FogBugz\website\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\FogBugz\website\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: BBPlugins.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aaf7db694a6a50c1
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
tracstarr Send private email
Monday, December 14, 2009
 
 
Hi Tracstarr
If you would like to send me your plugin zip, I can try loading it on one of my test instances.
Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz