共用方式為


IVsTrackProjectRetargetingEvents.OnRetargetingBeforeChange Method

Definition

Fired before a retargeting change occurs. This is the first event sent to subscribers. The subscriber can choose to cancel retargeting on receiving this event.

public:
 int OnRetargetingBeforeChange(System::String ^ projRef, Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pBeforeChangeHier, System::String ^ currentTargetFramework, System::String ^ newTargetFramework, [Runtime::InteropServices::Out] bool % pCanceled, [Runtime::InteropServices::Out] System::String ^ % ppReasonMsg);
int OnRetargetingBeforeChange(std::wstring const & projRef, Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & pBeforeChangeHier, std::wstring const & currentTargetFramework, std::wstring const & newTargetFramework, [Runtime::InteropServices::Out] bool & pCanceled, [Runtime::InteropServices::Out] std::wstring const & & ppReasonMsg);
public int OnRetargetingBeforeChange (string projRef, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pBeforeChangeHier, string currentTargetFramework, string newTargetFramework, out bool pCanceled, out string ppReasonMsg);
abstract member OnRetargetingBeforeChange : string * Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * string * string * bool * string -> int
Public Function OnRetargetingBeforeChange (projRef As String, pBeforeChangeHier As IVsHierarchy, currentTargetFramework As String, newTargetFramework As String, ByRef pCanceled As Boolean, ByRef ppReasonMsg As String) As Integer

Parameters

projRef
String

[in] The unique project reference name.

pBeforeChangeHier
IVsHierarchy

[in] The project hierarchy before the change.

currentTargetFramework
String

[in] The current target framework of the project.

newTargetFramework
String

[in] The new target framework of the project.

pCanceled
Boolean

[out] If true, retargeting was canceled by one of the subscribers.

ppReasonMsg
String

[out] A message string containing the reason why the cancelation occurred.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Applies to