Partager via


IVsTrackProjectRetargeting.OnSetTargetFramework Method

Called to initiate and orchestrate project retargeting. This method fires various retargeting events at different stages of the retargeting operation.

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

Syntax

'Declaration
Function OnSetTargetFramework ( _
    pHier As IVsHierarchy, _
    currentTargetFramework As String, _
    newTargetFramework As String, _
    pWorkerCallback As IVsSetTargetFrameworkWorkerCallback, _
    ReloadProject As Boolean _
) As Integer
int OnSetTargetFramework(
    IVsHierarchy pHier,
    string currentTargetFramework,
    string newTargetFramework,
    IVsSetTargetFrameworkWorkerCallback pWorkerCallback,
    bool ReloadProject
)
int OnSetTargetFramework(
    [InAttribute] IVsHierarchy^ pHier, 
    [InAttribute] String^ currentTargetFramework, 
    [InAttribute] String^ newTargetFramework, 
    [InAttribute] IVsSetTargetFrameworkWorkerCallback^ pWorkerCallback, 
    [InAttribute] bool ReloadProject
)
abstract OnSetTargetFramework : 
        pHier:IVsHierarchy * 
        currentTargetFramework:string * 
        newTargetFramework:string * 
        pWorkerCallback:IVsSetTargetFrameworkWorkerCallback * 
        ReloadProject:bool -> int
function OnSetTargetFramework(
    pHier : IVsHierarchy, 
    currentTargetFramework : String, 
    newTargetFramework : String, 
    pWorkerCallback : IVsSetTargetFrameworkWorkerCallback, 
    ReloadProject : boolean
) : int

Parameters

  • currentTargetFramework
    Type: String

    [in] The current target framework moniker of the project.

  • newTargetFramework
    Type: String

    [in] The target framework moniker to which the project is being retargeted.

  • ReloadProject
    Type: Boolean

    [in] true if the caller wants the project to be reloaded (the normal case).

Return Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

IVsTrackProjectRetargeting Interface

Microsoft.VisualStudio.Shell.Interop Namespace