VSIX Manifest 2.0

Nov 21, 2012 at 11:07 PM

Any plans to upgrade the existing VSIX Manifest files output by GAX/GAT to use the 2.0 schema?

I tried to upgrade the VSIX Manifest from the GAX/GAT for a custom extension from the 1.0-compatible schema to the 2.0. Everything translates easily except the current "Vsix/Content/CustomExtension" element. I cannot find any Microsoft documentation or helpful web posts for where this should or could be migrated.  The Microsoft schema docs do indicate that any elements placed after the "Assets" tag will be exposed to extensions (GAX/GAT in this case) as instances of "XmlElement". So, I tried simply leaving the 1.0 "Content" element below 2.0 "Assets" element and left the "CustomExtension" element and attributes as-is. Didn't work. So, I tried removing the wrapper "Content" element and exposing "CustomExtension" directly below "Assets". Didn't work.

Every attempt I make to retain the "CustomExtension" element results in the error "The VSIX manifest must define one GuidancePackage custom extension" during compile.

My next stop will be the GAX/GAT source code. I'll see what I can do...

Nov 21, 2012 at 11:36 PM
Edited Nov 27, 2012 at 11:19 PM

[Update 2012-11-27] In the end I couldn't get the below to properly load when the Extension was actually installed. I'd get strange behavior like all of the solution template's projects showing up as directly accessible project templates and odd errors when unfolding the solution templates. No time to dive that deep into the GAX source code at this moment... :(

[Original Post below...]

Found a solution! Looking at the source code, all I needed was the 2010 XML namespace on the "CustomExtension" element for the GAX MSBuild task to work!

So, for any others who may wish to use the 2012 VSIX Manifest version 2.0. Everything will map rather obviously except the CustomExtension element. Below are 1.0 and 2.0 examples respectively...

source.extension.vsixmanifest 1.0

 

<?xml version="1.0" encoding="utf-8"?>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
    <Identifier Id="[YourExtensionIdHere]">
        <Name>[YourExtensionNameHere]</Name>
        <Author>[YourExtensionAuthorHere]</Author>
        <Version>[YourExtensionVersionHere]</Version>
        <Description xml:space="preserve">[YourExtensionDescriptionHere]</Description>
        <Locale>1033</Locale>
        <Icon>Package.ico</Icon>
        <PreviewImage>Extension_Preview.png</PreviewImage>
        <InstalledByMsi>false</InstalledByMsi>
        <SupportedProducts>
            <VisualStudio Version="11.0">
                <Edition>Pro</Edition>
            </VisualStudio>
        </SupportedProducts>
        <SupportedFrameworkRuntimeEdition MinVersion="4.0" MaxVersion="4.5" />
    </Identifier>
    <References>
        <Reference Id="OpenGAX" MinVersion="2.0">
            <Name>GAX 2010 For Visual Studio 2012</Name>
        </Reference>
    </References>
    <Content>
        <VsPackage>|%CurrentProject%;PkgdefProjectOutputGroup|</VsPackage>
        <CustomExtension Type="GuidancePackage">[YourExtensionGuidanceXmlNameHere]Guidance.xml</CustomExtension>
    </Content>
</Vsix>

 

source.extension.vsixmanifest 2.0

 

<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
    <Metadata>
        <Identity Id="[YourExtensionIdHere]" Version="[YourExtensionVersionHere]" Language="en-US" Publisher="[YourExtensionAuthorHere]" />
        <DisplayName>[YourExtensionNameHere]</DisplayName>
        <Description xml:space="preserve">[YourExtensionDescriptionHere]</Description>
        <MoreInfo>[YourExtensionUrlHere]</MoreInfo>
        <Icon>Package.ico</Icon>
        <PreviewImage>Extension_Preview.png</PreviewImage>
        <Tags>[YourExtensionTagsHere]</Tags>
    </Metadata>
    <Installation InstalledByMsi="false">
        <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="11.0" />
    </Installation>
    <Dependencies>
        <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.5" />
        <Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="11.0" />
    </Dependencies>
    <Assets>
        <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
    </Assets>
    <CustomExtension xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010" Type="GuidancePackage">[YourExtensionGuidanceXmlNameHere]Guidance.xml</CustomExtension>
</PackageManifest>
Oct 29, 2013 at 6:26 AM
Hi,

I was trying to do this as well and the error I got was:

System.InvalidOperationException: Cannot find registration information for template "Templates\Solutions\Layered.vstemplate". Package templates may not be properly registered. Run package installation again and verify template name and location.
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.VSTemplatesService.GetTemplateRegistryData(String templateFileName)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.VSTemplatesService.Microsoft.Practices.RecipeFramework.VisualStudio.Common.IVsTemplatesService.GetTemplate(String templateFileName)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.VszWizard.EnvDTE.IDTWizard.Execute(Object Application, Int32 hwndOwner, Object[]& ContextParams, Object[]& CustomParams, wizardResult& retval)


Layered.vstemplate is my template name and it exist in the folder.

Hugs,
Serena