In the screenshot below compiler and IntelliSense show that unless I uncomment the using
statement the program
instance is not a valid argument to SatisfyImportsOnce
. It's not matching signature based on base class/interface/implicit convert as far as I can tell and both have relevant references, so how does it know? What is this using
check called and how is does it work?
Without the using
, the compiler finds only this method , in the System.ComponentModel.Composition.Hosting
namespace, which only takes a ComposablePart
parameter
With the using, it also finds this extension method which takes an object
parameter.
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.