简体   繁体   中英

loading 3rd party assemblies dynamically

We have a scenario where we have built an API that we will provide to 3rd parties to develop their own packages to run alongside our own. The 3rd parties will be our brother/sister companies so they can be considered 'trusted' as far as what they build (we will of course review their code before putting it into our live environment, but no worries of nefarious content at least).

The packages that we developed internally are introspected and invoked thru MEF so we'd like to do the same for the 3rd parties. My question I guess, is what is the best way to accomplish this exactly? My initial thought was to create an ExternalDLLs folder where we will release to when we want to add a 3rd party package. Then our system will need to introspect what is available on startup...see if there is anything new to add (we will record all this in a db) and add it if needed. Will this work? Is there a better way? Any other gotchas to be aware of?

if I'm being unclear please let me know and I will clarify, much thanks guys!

好吧,如果您已经在使用MEF,那么只需为您的ExternalURLs文件夹添加DirectoryCatalog就可以了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM