System.Composition: Bug in Resolving Activators Due to the .NET Type System #16683
Description
I have been tracking down a pretty nasty bug today in regards to System.Composition. After a discussion about this on StackOverflow, I have decided to open an issue here in hopes to get additional conversation/context/insight around this.
Essentially, there appears to be a race condition when accessing System.Reflection
elements for the first time from different threads. In the case of System.Composition, it relies on a ParameterInfo
object when determining an activator to use for a dependency.
Due to the issue as explained above in StackOverflow, the ParameterInfo
object may or may not be the expected key at this point, since the stored ParameterInfo
in the CompositionDependency.Site.Parameter
may or may not be the same object that gets returned after the value has been initialized and cached in the System.Reflection system.
Activity