Whitelisting assemblies to scan for addin roots

21 views
Skip to first unread message

Weeble

unread,
Nov 30, 2011, 11:26:23 AM11/30/11
to Mono.Addins
I would like to prevent scanning for addins and addin roots of DLLs in
my application directory except for those that I explicitly whitelist.
Right now I have to add <exclude> entries for every *other* DLL in
that directory. I see that AddinFileSystemExtension can be used to
provide a virtualized view of the file-system to the scanner, so it
seems theoretically possible that I could just provide it with a view
that hides all DLLs except for the ones in my whitelist. However, I
can't see a way to use this correctly. I can register this with an
AddinRegistry with RegisterExtension, but AddinEngine.Initialize
creates a new AddinRegistry and then immediately starts scanning with
it, before I have an opportunity to register any extension with it. So
even though I can eventually register the extension, it's too late,
because the registry has already scanned all the DLLs in the
application directory.

1. Aside from this issue, is AddinFileSystemExtension suitable for
this purpose?
2. Is there a way around this problem without a change in Mono.Addins?
3. If not, I could probably change Mono.Addins to achieve what I want,
but how can I maximize the chance that my patch would be accepted back
into the project?

Regards,
Weeble.

Lluis Sanchez Gual

unread,
Dec 19, 2011, 12:56:19 PM12/19/11
to mono-...@googlegroups.com
El 30/11/2011, a las 17:26, Weeble escribió:

I would like to prevent scanning for addins and addin roots of DLLs in
my application directory except for those that I explicitly whitelist.
Right now I have to add <exclude> entries for every *other* DLL in
that directory. I see that AddinFileSystemExtension can be used to
provide a virtualized view of the file-system to the scanner, so it
seems theoretically possible that I could just provide it with a view
that hides all DLLs except for the ones in my whitelist. However, I
can't see a way to use this correctly. I can register this with an
AddinRegistry with RegisterExtension, but AddinEngine.Initialize
creates a new AddinRegistry and then immediately starts scanning with
it, before I have an opportunity to register any extension with it. So
even though I can eventually register the extension, it's too late,
because the registry has already scanned all the DLLs in the
application directory.

1. Aside from this issue, is AddinFileSystemExtension suitable for
this purpose?

Not really. I added AddinFileSystemExtension with the intention to use it in a MonoDevelop add-in for building add-ins (which is not finished). 

2. Is there a way around this problem without a change in Mono.Addins?

I fear not.


3. If not, I could probably change Mono.Addins to achieve what I want,
but how can I maximize the chance that my patch would be accepted back
into the project?

The best solution would be to extend the .addins file format to allow specifying a whole directory to exclude, and a set of files to include (the white list).

Lluis.

Reply all
Reply to author
Forward
0 new messages