IVsSharedProjectReferencesHelper::ChangeSharedMSBuildFileImports Method (IVsHierarchy^, Array^, Array^, String^)

Visual Studio 2015
 

Changes the set of Shared MSBuild files imported by a project.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime (in Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll)

bool ChangeSharedMSBuildFileImports(
	IVsHierarchy^ importingProject,
	Array^ importFullPathsToRemove,
	Array^ importFullPathsToAdd,
	String^ szImportLabel
)

Parameters

importingProject
Type: Microsoft.VisualStudio.Shell.Interop::IVsHierarchy^

The project that is being modified.

importFullPathsToRemove
Type: System::Array^

A list of MSBuild project file full paths (e.g. *.projitems) that should be removed from being imported.

importFullPathsToAdd
Type: System::Array^

A list of MSBuild project file full paths (e.g. *.projitems) that should be added as imports.

szImportLabel
Type: System::String^

The label used to identify the MSBuild import statements of interest (e.g. Shared Project References use import statements with the label = "Shared").

Return Value

Type: System::Boolean

True if the project has been reloaded, false if not.

This method may cause the importingProject to be reloaded as part of this operation. If this method returns true that the project was reloaded, then the caller must get the project again by calling IVsSolution.GetProjectOfGuid or similar mechanism after this method returns. If any errors occur, then no changes will be committed to the project file on disk.

Return to top
Show: