コード例 #1
0
        private static IEnumerable <VisualStudioInstance> GetInstances(VisualStudioInstanceQueryOptions options)
        {
#if NET46
            var devConsole = GetDevConsoleInstance();
            if (devConsole != null)
            {
                yield return(devConsole);
            }

    #if FEATURE_VISUALSTUDIOSETUP
            foreach (var instance in VisualStudioLocationHelper.GetInstances())
            {
                yield return(instance);
            }
    #endif
#endif

#if NETCOREAPP
            var dotnetSdk = DotNetSdkLocationHelper.GetInstance(options.WorkingDirectory);
            if (dotnetSdk != null)
            {
                yield return(dotnetSdk);
            }
#endif
        }
コード例 #2
0
        private static IEnumerable <VisualStudioInstance> GetInstances()
        {
            var devConsole = GetDevConsoleInstance();

            if (devConsole != null)
            {
                yield return(devConsole);
            }

            foreach (var instance in VisualStudioLocationHelper.GetInstances())
            {
                yield return(instance);
            }
        }