IVsTrackProjectRetargeting::OnSetTargetFramework Method (IVsHierarchy^, String^, String^, IVsSetTargetFrameworkWorkerCallback^, Boolean)
Called to initiate and orchestrate project retargeting. This method fires various retargeting events at different stages of the retargeting operation.
Assembly: Microsoft.VisualStudio.Shell.Interop.10.0 (in Microsoft.VisualStudio.Shell.Interop.10.0.dll)
int OnSetTargetFramework( IVsHierarchy^ pHier, String^ currentTargetFramework, String^ newTargetFramework, IVsSetTargetFrameworkWorkerCallback^ pWorkerCallback, bool ReloadProject )
Parameters
- pHier
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsHierarchy^
[in] The hierarchy of the project that needs to be retargeted.
- currentTargetFramework
-
Type:
System::String^
[in] The current target framework moniker of the project.
- newTargetFramework
-
Type:
System::String^
[in] The target framework moniker to which the project is being retargeted.
- pWorkerCallback
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsSetTargetFrameworkWorkerCallback^
[in] The worker callback interface that actually writes the retargeting information in the project file.
- ReloadProject
-
Type:
System::Boolean
[in] true if the caller wants the project to be reloaded (the normal case).
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
When using this method, the normal situation is to call with ReloadProject set to true. If ReloadProject is false, the expectation is that the calling project is ready to deal with the new framework version without a reload.