Skip to content

Support equivalent of ComposeExportedValue in System.Composition #18624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsplaisted opened this issue Sep 19, 2016 · 10 comments
Closed

Support equivalent of ComposeExportedValue in System.Composition #18624

dsplaisted opened this issue Sep 19, 2016 · 10 comments
Labels
api-needs-work API needs work before it is approved, it is NOT ready for implementation area-System.Composition untriaged New issue has not been triaged by the area owner
Milestone

Comments

@dsplaisted
Copy link
Member

System.ComponentModel.Composition (MEF1) has the ability to supply imports to an already-instantiated object, via the ComposeExportedValue<T>(T exportedValue) method. As requested by @ZigMeowNyan and @jabbera in #15362, it would be useful to have this ability in System.Composition (MEF2).

@karelz
Copy link
Member

karelz commented Nov 23, 2016

We need formal API proposal

@NEKIT-Boss
Copy link

Add methods to ContainerConfiguration class:

public ContainerConfiguration WithInstance<TExport> (TExport instance);
public ContainerConfiguration WithInstance<TExport> (string contractName, TExport instance);
public ContainerConfiguration WithInstance (Type t, object instance);
public ContainerConfiguration WithInstance (Type t, string contractName, object instance);

@siobhanc
Copy link

Just adding a +1 to this request. Heavily reliant on ComposeExportedValue and without it, or a sensible workaround, will have to completely redesign my system in order to port to .Net Core

@exones
Copy link

exones commented Oct 16, 2017

This is very frustrating lack of functionality, I join @siobhanc in his comment

@pascalpfeil
Copy link

+1 for this

@gthvidsten
Copy link

+1 (Surprised nothing has happened after 2.5 years!)

@danmoseley
Copy link
Member

Nobody has made a formal API proposal. Guidelines for the format are in the docs folder in this repo. Then the API board can review. If approved, we would welcome a PR with tests from the community.

@gthvidsten
Copy link

@danmosemsft Care to provide a direct link to the guideline?

@danmoseley
Copy link
Member

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@ericstj
Copy link
Member

ericstj commented Jul 9, 2020

I believe this is now tracked with #29400

@ericstj ericstj closed this as completed Jul 9, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-needs-work API needs work before it is approved, it is NOT ready for implementation area-System.Composition untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests