Skip to content
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

MEFv2 attributes make importing SAsyncServiceProvider hard #138

Open
AArnott opened this issue May 31, 2019 · 0 comments
Open

MEFv2 attributes make importing SAsyncServiceProvider hard #138

AArnott opened this issue May 31, 2019 · 0 comments
Assignees
Labels

Comments

@AArnott
Copy link
Member

AArnott commented May 31, 2019

In the following two MEF parts running in VS, the MEFv1Part gets both properties set to a non-null value, while the MEFv2Part only has the second property set to a non-null value.

Why is that? Is it by design of how MEFv2 attributes behave or a bug in VS-MEF?

        [MEFv1.Export]
        public class MEFv1Part
        {
            [MEFv1.Import(typeof(SAsyncServiceProvider), AllowDefault = true)]
            public Microsoft.VisualStudio.Shell.IAsyncServiceProvider AsyncServiceProvider { get; set; }

            [MEFv1.Import(typeof(SAsyncServiceProvider), AllowDefault = true)]
            public object AsyncServiceProvider3 { get; set; }
        }

        [MEFv2.Export]
        public class MEFv2Part
        {
            [MEFv2.Import("Microsoft.VisualStudio.Shell.Interop.SAsyncServiceProvider", AllowDefault = true)]
            public Microsoft.VisualStudio.Shell.IAsyncServiceProvider AsyncServiceProvider { get; set; }

            [MEFv2.Import("Microsoft.VisualStudio.Shell.Interop.SAsyncServiceProvider", AllowDefault = true)]
            public object AsyncServiceProvider3 { get; set; }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant