Project System Extensibility Breaking Changes for Visual Studio 2017

December 13, 2018 ยท View on GitHub

We have made several breaking changes for the next version of Project System Extensibility. Our goal with these changes is to provide a consistent assembly name over releases, simplified namespaces, and new features. Below is a list of these changes.

Assembly Rename and Consolidation

We have renamed all of our assemblies to the following:

Old NameNew Name
Microsoft.VisualStudio.ProjectSystem.v14OnlyMicrosoft.VisualStudio.ProjectSystem
Microsoft.VisualStudio.ProjectSystem.VS.v14OnlyMicrosoft.VisualStudio.ProjectSystem.VS

Microsoft.VisualStudio.ProjectSystem.Utilities.14.0 has been removed, and its contents merged into the other 2 assemblies.

Namespace Changes

Namespaces have been heavily refactored.

New Namespaces
Microsoft.VisualStudio.ProjectSystem
Microsoft.VisualStudio.ProjectSystem.Build
Microsoft.VisualStudio.ProjectSystem.Debug
Microsoft.VisualStudio.ProjectSystem.Properties
Microsoft.VisualStudio.ProjectSystem.References
Microsoft.VisualStudio.ProjectSystem.VS
Microsoft.VisualStudio.ProjectSystem.VS.Build
Microsoft.VisualStudio.ProjectSystem.VS.Debug
Microsoft.VisualStudio.ProjectSystem.VS.Properties

Interface Merging

In VS2015 update 1 we added some '2' versions of various interfaces. These interfaces have been merged into the original version of the interface.

Interface SourceInterface Target
IProjectService2IProjectService
IProjectTreeFactory2IProjectTreeFactory
IVsLoggerProvider2IVsLoggerProvider
IBuildProject2IBuildProject
IProjectItemProvider2*IProjectItemProvider

* the addition methods from IProjectItemProvider2 where added onto ProjectItemProviderBase

Adds, Removals, and Renames

Added

NewDescription
IProjectTreePropertiesProviderNew extension point for modifying IProjectTree
NamedIdentityUsed for naming and identifiying IProjectValueDataSource
ProjectTreeFlagsReplacement for IProjectTree.Capabilities
IProjectDynamicLoadComponentNew extension point for components that support being dynamically loaded/unloaded
IProjectCapabilitiesScopeScopes the current capabilities to support dynamic capabilities

Removals

RemovedDescription
UnconfiguredProjectAutoLoadAttributeReplaced by ProjectAutoLoadAttribute
IProjectTreeModifierReplaced by IProjectTreePropertiesProvider
WeakKeyDictionary-
IProjectCapabilityCheckProviderReplaced by IProjectCapabilitiesScope
ProjectCapabilitiesKeyPropertiesProvider-
IProjectValueDataSource<T>.DataSourceKeyAppears on IProjectValueDataSource
IProjectValueDataSource<T>.DataSourceVersionAppears on IProjectValueDataSource
UnconfiguredProject.GetCapabilitiesAsyncreplaced by UnconfiguredProject.Capabilities
ConfiguredProject.GetCapabilitiesAsyncreplaced by ConfiguredProject.Capabilities

Renames

Old NameNew Name
ProjectServiceIProjectService
UnconfiguredProjectAutoLoad2AttributeProjectAutoLoadAttribute
OrderPrecedenceAttributeOrderAttribute
IThreadHandlingIProjectThreadingService
IThreadHandling.AsyncPumpIProjectThreadingService.JoinableTaskFactory
IProjectTree.CapabilitiesIProjectTree.Flags
IProjectReloader.ReloadIfCapabilitiesChangedAsyncIProjectReloader.ReloadIfNecessaryAsync

Behavioral Changes

  • Dynamic capability support added. This makes capabilities a part of the data flow. More information can be found here.
  • The contract for ProjectAutoLoadAttribute (previously UnconfiguredProjectAutoLoadAttribute) has changed from void Initialize() to Task Initialize()
  • IProjectThreadingService.SwitchToUIThread is now an extension method
  • IProjectTree.Flags is a new struct ProjectTreeFlags which is a hybrid of enum and ImmutableHashSet<string>. Most commonly used flags are found in enum ProjectTreeFlags.Common.
  • ExportCommandGroupAttribute.Group is now a Guid (formerly string). The constructor accepts either a string or guid.
  • Implementation of IVsProject.IsDocumentInProject changed to return not found for items of DP2_NonMember and below. Previously it would return true for excluded items underneath the project directory.
    • You can use IVsHierarchy.ParseCanonicalName to check if an item is under the project directory, but may not be included.
  • IProjectSubscriptionService.XXXBlock marked obsolete. Use IProjectSubscriptionService.XXXSource.SourceBlock instead.
  • IProjectValueDataSource.DataSourceKey changed from Guid to a new class NamedIdentity. This allows for naming the data source with a string.
  • StaticGlobalPropertiesProviderBase constructor now takes only an IProjectCommonServices.
  • UnconfiguredProject.Capabilities and ConfiguredProject.Capabilities type changed from IImmutableSet<string> to IProjectCapabilitiesScope