Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 717 Bytes

detect_whether_a_project_is_a_CPS_project.md

File metadata and controls

19 lines (16 loc) · 717 Bytes

How to detect whether a project is a CPS project

The following code snippet demonstrates how to detect whether a given project is a "pure" CPS-based project system (e.g. JavaScript, and not VC++ which is only half CPS). This technique does not require referencing any CPS-specific assemblies, and therefore has the advantage of not risking having breaks with subsequent versions of Visual Studio when CPS changes its unstable API.

    using Microsoft.VisualStudio.Shell;

    internal static bool IsCpsProject(this IVsHierarchy hierarchy)
    {
        Requires.NotNull(hierarchy, "hierarchy");
        return hierarchy.IsCapabilityMatch("CPS");
    }