public static NuSpec Read(FileSystemPath path)
        {
            if (!path.ExistsFile)
            return null;

              NuSpec nuspec = null;

              Logger.CatchSilent(() =>
              {
            using (var stream = path.OpenFileForReading())
            {
              stream.ReadXml(packageReader =>
              {
            if (!packageReader.ReadToDescendant("metadata"))
              return;

            packageReader.ReadElement(metadataReader =>
            {
              if (metadataReader.LocalName != "metadata")
                return;

              nuspec = new NuSpec();
              metadataReader.ReadSubElements(childReader =>
              {
                Action<NuSpec, string> action;
                if (StringActions.TryGetValue(childReader.LocalName, out action))
                  action(nuspec, childReader.ReadElementContentAsString());
              });
            });
              });
            }
              });

              return nuspec;
        }
        public VsixExtension(IExtensionProvider provider, NuSpec nuSpec, FileSystemPath location, 
      ExtensionLocations extensionLocations)
        {
            var source = GetType().Name;

              this.nuSpec = nuSpec;
              this.location = location;
              this.extensionLocations = extensionLocations;

              Version = new Version(nuSpec.Version);
              Metadata = new VsixExtensionMetadata(nuSpec);
              Supported = true; // TODO
              Enabled = new Property<bool?>(string.Format("{0}::Enabled", source), null);
              RuntimeInfoRecords = new ListEvents<ExtensionRecord>(string.Format("{0}::RuntimeInfoRecords", source));
              Source = provider;
        }
            public VsixExtensionMetadata(NuSpec nuSpec)
            {
                this.nuSpec = nuSpec;

                Authors = nuSpec.Authors;
                Owners = nuSpec.Owners;
                Tags = nuSpec.Tags;

                IconUrl = nuSpec.IconUrl;
                LicenseUrl = nuSpec.LicenseUrl;
                ProjectUrl = nuSpec.ProjectUrl;

                Created = null;
                PreRelease = nuSpec.Version == Version.Parse(nuSpec.Version).ToString();
            }