Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

Created Issue: Shared part instantiated twice [14604]

$
0
0
When a:
* Shared part
* Involved in a circular dependency
* Has more than one export

Then the part should be created only once but is instantiated twice.

Found in version 1.0.16.

Failing test case below.

```
[Shared, Export, Export("named")]
public class TwoExports
{
[Import]
public CircularImporter Importer { get; set; }
}

[Shared, Export]
public class CircularImporter
{
[Import]
public TwoExports TwoExports { get; set; }
}

[TestMethod]
public void SharedPartWithManyExportsInCircularityCreatedOnce()
{
var container = new ContainerConfiguration()
.WithPart<TwoExports>()
.WithPart<CircularImporter>()
.CreateContainer();

var a = container.GetExport<TwoExports>("named");
var b = container.GetExport<TwoExports>();
Assert.AreSame(a, b);
}
```


Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>