I have this relatively simple program:
open System
open System.ComponentModel.Composition
open System.ComponentModel.Composition.Hosting
open System.Reflection
module Config =
[<Export("Timer.Delay")>]
let Delay = TimeSpan.FromSeconds(5.0)
[<EntryPoint>]
let main argv =
let catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly())
let container = new CompositionContainer(catalog)
let delay = container.GetExportedValue<TimeSpan> "Timer.Delay"
printfn "Delay: %A" delay
But I get this error when called container.GetExportedValue<TimeSpan> "Timer.Delay":
More than one export was found that matches the limit:
& EPRS; ContractName & EPRS; & EPRS; & EPRS; & EPRS; & thinsp; Timer.delay
& EPRS; RequiredTypeIdentity & EPRS; System.TimeSpan
Checking the collection catalog.Parts, I see two parts, each with one ExportDefinition. The first one for Program+Configwhich I would expect to find, and one for <StartupCode$Remote>.$Program(note the assembly name Remote):

main module Program . - , F # ? ?