Пример #1
0
        private static Assembly LoadSettingsAssembly(VsVersion version)
        {
            var    format = "Microsoft.VisualStudio.Settings{0}, Version={1}.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            string suffix = "";

            switch (version)
            {
            case VsVersion.Vs2010:
                suffix = "";
                break;

            case VsVersion.Vs2012:
                suffix = ".11.0";
                break;

            case VsVersion.Vs2013:
                suffix = ".12.0";
                break;

            case VsVersion.Vs2015:
                suffix = ".14.0";
                break;

            case VsVersion.Vs2017:
                suffix = ".15.0";
                break;

            default:
                throw new Exception("Bad Version");
            }

            var strongName = string.Format(format, suffix, VsVersionUtil.GetVersionNumber(version));

            return(Assembly.Load(strongName));
        }
Пример #2
0
        private static Assembly LoadImplementationAssembly(VsVersion version)
        {
            var format     = "Microsoft.VisualStudio.ExtensionManager.Implementation, Version={0}.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
            var strongName = string.Format(format, VsVersionUtil.GetVersionNumber(version));

            return(Assembly.Load(strongName));
        }
Пример #3
0
 public static IEnumerable <InstalledVersion> GetLegacyInstalledVersions()
 {
     foreach (var vsVersion in LegacyVersions)
     {
         var majorVersion = VsVersionUtil.GetVersionNumber(vsVersion);
         var appPath      = GetApplicationPathFromRegistry(majorVersion);
         if (appPath != null && File.Exists(appPath))
         {
             yield return(new InstalledVersion(appPath, vsVersion));
         }
     }
 }
Пример #4
0
 internal static string GetAssemblyVersionNumber(VsVersion version)
 {
     return(string.Format("{0}.0.0.0", VsVersionUtil.GetVersionNumber(version)));
 }