views:

309

answers:

2

I'm doing a addin system where the main app loads assemblies Addin1.dll and Addin2.dll on runtime in new AppDomain's.

However, in case that Addin1.dll is signed (strong name) with my key and Addin2.dll is not, I want to be able to only load Addin1.dll and reject Addin2.dll.

I'm suspecting that it needs to be done by setting some parameters in AppDomainSetup?

+1  A: 

Look into the Assembly.Load method that takes an Evidence parameter. You can find an example of how to create an evidence from your public key here.

tvanfosson
A: 

You can implment a DomainManager and base your load/block decision's on whatever you like. I answered a somewhat related question here.

RandomNickName42