Replace uses of:
[PartMetadata(ProjectCapabilities.Requires, "…")]
With:
[AppliesTo("…")]
If you have any class members that are themselves exported, you should
add the [AppliesTo]
attribute to each of those members as well to match
the one that appears on the exported class (if any).
If you have exports that have neither of these attributes, they will be ignored
in VS2015. VS2013 allowed you to leave the PartMetadata
attribute off and
defaulted to allowing that export to modify all CPS based projects. That was
an unsafe default so the default in VS2015 is to ignore all exports that are
missing the attribute that indicates which types of projects an extension
should apply to.
Imports of IVsHierarchy
, IVsProject
, or IProjectConfigurationService
must
be changed from:
[Import(x)]
Lazy<T> ImportingProperty { get; set; }
to:
[ImportMany(x)]
OrderPrecedenceImportCollection<T> ImportingPropertyCollection { get; set; }
Lazy<T> ImportingProperty
{
get { return this.ImportingPropertyCollection.First(); }
}
For any ImportMany
of OrderPrecedenceImportCollection
that you introduce,
you must add a line to your importing constructor:
[ImportingConstructor]
YourExtensionClassName(ConfiguredProject project)
{
this.ImportedExtensions = new OrderPrecedenceImportCollection<T>(
projectCapabilityCheckProvider: project);
}
Replace this pattern:
[Export(typeof(IDynamicEnumValuesProvider))]
[DynamicEnumCategory("…")]
with:
[ExportDynamicEnumValuesProvider("…")]