Udostępnij za pośrednictwem


IVsSolution5.ResolveFaultedProjects Method

Definition

Resolves faulted projects.

public:
 void ResolveFaultedProjects(System::UInt32 cHierarchies, cli::array <Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^> ^ rgHierarchies, Microsoft::VisualStudio::Shell::Interop::IVsPropertyBag ^ pProjectFaultResolutionContext, [Runtime::InteropServices::Out] System::UInt32 % pcResolved, [Runtime::InteropServices::Out] System::UInt32 % pcFailed);
void ResolveFaultedProjects(unsigned int cHierarchies, std::Array <Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const &> const & rgHierarchies, Microsoft::VisualStudio::Shell::Interop::IVsPropertyBag const & pProjectFaultResolutionContext, [Runtime::InteropServices::Out] unsigned int & pcResolved, [Runtime::InteropServices::Out] unsigned int & pcFailed);
public void ResolveFaultedProjects (uint cHierarchies, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy[] rgHierarchies, Microsoft.VisualStudio.Shell.Interop.IVsPropertyBag pProjectFaultResolutionContext, out uint pcResolved, out uint pcFailed);
abstract member ResolveFaultedProjects : uint32 * Microsoft.VisualStudio.Shell.Interop.IVsHierarchy[] * Microsoft.VisualStudio.Shell.Interop.IVsPropertyBag * uint32 * uint32 -> unit
Public Sub ResolveFaultedProjects (cHierarchies As UInteger, rgHierarchies As IVsHierarchy(), pProjectFaultResolutionContext As IVsPropertyBag, ByRef pcResolved As UInteger, ByRef pcFailed As UInteger)

Parameters

cHierarchies
UInt32

[in] The number of project hierarchies that are to be resolved. If this parameter is empty (cHierarchies == 0), all faulted projects in the solution are resolved.

rgHierarchies
IVsHierarchy[]

[in, size_is(cHierarchies)] Array of project hierarchies that are to be resolved.

pProjectFaultResolutionContext
IVsPropertyBag

[in, unique] Property bag to be used as a fault resolution context. If this parameter is provided, VSPROPID_ProjectFaultResolutionContext references this property bag for the duration of the call. The caller can use this property bag to pass initial values for specific properties instead of the default values. If null is passed in this parameter, a new blank property bag will be used as the context.

pcResolved
UInt32

[out] The number of projects for which resolution was attempted (that is, that ResolveFault(Boolean) called and/or the project reloaded). This might be less than cHierarchies if some of the projects in rgHierarchies are not faulted, or if one of the projects failed to resolve with OLE_E_PROMPTSAVECANCELLED.

pcFailed
UInt32

[out] The number of projects that remain in the faulted state after an attempted resolution. This parameter does not count projects for which resolution was not attempted, for example those following the project that failed to resolve with OLE_E_PROMPTSAVECANCELLED.

Remarks

The fault resolution process is as follows. For each project hierarchy in rgHierarchies:

  1. Query VSHPROPID_IsFaulted. If it is false, then skip this project.

  2. Check whether the hierarchy supports IVsProjectFaultResolver.

  3. If IVsProjectFaultResolver is supported, call ResolveFault on the hierarchy. If it fails with OLE_E_PROMPTSAVECANCELLED, then stop processing projects and return OLE_E_PROMPTSAVECANCELLED.

  4. If IVsProjectFaultResolver is not supported, or if ResolveFault set *pfShouldReload to true, reload the hierarchy. If it fails with OLE_E_PROMPTSAVECANCELLED, then stop processing projects and return OLE_E_PROMPTSAVECANCELLED.

Applies to