Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ReflectionModelServices.IsExportFactoryImportDefinition should not throw #12461

@KirillOsenkov

Description

@KirillOsenkov

After .NET 4.5 .NET Framework has changed the System.ComponentModel.Composition ReflectionModelServices.IsExportFactoryImportDefinition to not throw:

        public static bool IsExportFactoryImportDefinition(ImportDefinition importDefinition)
        {
            Requires.NotNull(importDefinition, "importDefinition");

            return (importDefinition is IPartCreatorImportDefinition);
        }

We still seem to have a snapshot of that code that throws:

if (reflectionImportDefinition == null)
{
throw new ArgumentException(
string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()),
"importDefinition");
}

It would be nice to update that to match the latest .NET Framework sources.

This is blocking VSMEF here:
https://github.com/Microsoft/vs-mef/blob/9eb8e1d42918ad8d4a422f2dd005df0f96089599/src/Microsoft.VisualStudio.Composition/Configuration/NetFxAdapters.cs#L158-L161

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions