Share via


IVsAppCompat Interface

The IVsAppCompat interface is typically used to break compatibility of projects with previous versions of the application. This interface is available via the SVsSolution service.

For more information, see How to: Modify a Project System So That Projects Load in Multiple Versions of Visual Studio.

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

Syntax

'Declaration
<GuidAttribute("0F9810E7-36BA-4986-938B-F7E14EE02F9A")> _
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IVsAppCompat
[GuidAttribute("0F9810E7-36BA-4986-938B-F7E14EE02F9A")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsAppCompat
[GuidAttribute(L"0F9810E7-36BA-4986-938B-F7E14EE02F9A")]
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)]
public interface class IVsAppCompat
[<GuidAttribute("0F9810E7-36BA-4986-938B-F7E14EE02F9A")>]
[<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)>]
type IVsAppCompat =  interface end
public interface IVsAppCompat

The IVsAppCompat type exposes the following members.

Methods

  Name Description
Public method AskForUserConsentToBreakAssetCompat Shows a dialog box that asks for user consent to break the compatibility of projects in a list. If the user does not agree to continue, this method throws a COMException with an ErrorCode of OLE_E_PROMPTSAVECANCELLED.
Public method BreakAssetCompatibility
Public method GetCurrentDesignTimeCompatVersion Gets the current design time-compatibility version for this version of Visual Studio.

Top

Remarks

When you need to break compatibility, the project system should first call AskForUserConsentToBreakAssetCompat before calling BreakAssetCompatibility.

The following call sequence is typical:

  1. Call the AskForUserConsentToBreakAssetCompat method to show a dialog box that asks for user consent. If the user does not agree to continue, this method throws a COMException with an ErrorCode of OLE_E_PROMPTSAVECANCELLED.

  2. If a COMException is not thrown, make the changes that break the compatibility.

  3. To finalize the compatibility break, call the BreakAssetCompatibility method.

  4. The BreakAssetCompatibility method calls the GetCurrentDesignTimeCompatVersion method to obtain a string that represents the current version of Visual Studio.

  5. The BreakAssetCompatibility method then calls the SetProperty method to set the project VSHPROPID_MinimumDesignTimeCompatVersion property to the value of the version string that was obtained in the previous step.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace