locked
Can I build a VSIX v3 with Visual Studio 2015 RRS feed

  • Question

  • Hi

    Following the docs https://github.com/Microsoft/visualstudio-docs/blob/master/docs/extensibility/faq-2017.md#can-i-build-a-vsix-v3-with-visual-studio-2015.

    1) I used VS2015 to create an empty VSIX for testing and also added a dummy Package using the template

    2) Edited the csproj and  added as first element

    <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
    <VsixType>v3</VsixType>
    </PropertyGroup>

    3) Install https://www.nuget.org/packages/Microsoft.VisualStudio.Sdk.BuildTasks.14.0/ -pre using the Nuget packaage manager (note that docs do not mention a -pre release but is the only release)

    4) Edit my manifest as

      

    <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="VSIXProject2.Apostolis Bekiaris.e6975a63-4cf4-4a4d-a2f8-90ff8e8ce2e0" Version="1.0" Language="en-US" Publisher="Apostolis Bekiaris" />
        <DisplayName>VSIXProject2</DisplayName>
        <Description>Empty VSIX Project.</Description>
      </Metadata>
      <Installation>
        <InstallationTarget Version="[14.0,15.0)" Id="Microsoft.VisualStudio.Community" />
        <InstallationTarget Version="[14.0,15.0)" Id="Microsoft.VisualStudio.Pro" />
        <InstallationTarget Version="[14.0,15.0)" Id="Microsoft.VisualStudio.Enterprise" />
        <InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
      </Installation>
      <Dependencies>
        <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
        <Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
      </Dependencies>
      <Assets>
        <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
      </Assets>
      <Prerequisites>
        <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)"/>
      </Prerequisites>

    </PackageManifest>

    5. Compile with no error however my vsix does not contain any json file thus v3 is not supperted and VS2017 fails.

    any ideas what I might miss?


    Wednesday, April 19, 2017 2:42 AM

Answers

  • Hi Tolis Bekiaris,

    Based on your description and related document, I create a simple custom command demo, it works on my side.

    1. add the package (Microsoft.VisualStudio.Sdk.BuildTasks.14.0) by using NuGet

    2. modify csproj file like this:

    <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Import Project="..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.12-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.12-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props')" />
      <PropertyGroup>
        <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
        <NuGetPackageImportStamp>
        </NuGetPackageImportStamp>
        <UseCodebase>true</UseCodebase>
        <VsixType>v3</VsixType>
      </PropertyGroup>

    3. modify vsixmanifest file like this:

    <?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="VSIXProject3.leo.9dfe1eb8-314c-4fa1-a176-7a865703aa45" Version="1.0" Language="en-US" Publisher="leo" />
        <DisplayName>VSIXProject3</DisplayName>
        <Description>Empty VSIX Project.</Description>
      </Metadata>
      <Installation>
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="14.0" />
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="15.0" />
      </Installation>
      <Prerequisites>
        <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
        <Prerequisite Id="Microsoft.VisualStudio.Component.Web" Version="[15.0,16.0)" DisplayName="Web development tools" />
      </Prerequisites>
      <!--<Dependencies>
        <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
        <Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
      </Dependencies>-->
      <Assets>
        <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
        <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
      </Assets>
      <!--<Assets>
        <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
      </Assets>-->
    </PackageManifest>
    

    For the complete demo, please download the demo as below.

    https://1drv.ms/u/s!AlvaNEnglADDgQawIOMZLO-HIT-T

    Best regards,

    Cole Wu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Friday, April 21, 2017 1:25 AM

All replies

  • Hi Tolis Bekiaris,

    Based on your description and related document, I create a simple custom command demo, it works on my side.

    1. add the package (Microsoft.VisualStudio.Sdk.BuildTasks.14.0) by using NuGet

    2. modify csproj file like this:

    <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Import Project="..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.12-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.12-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props')" />
      <PropertyGroup>
        <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
        <NuGetPackageImportStamp>
        </NuGetPackageImportStamp>
        <UseCodebase>true</UseCodebase>
        <VsixType>v3</VsixType>
      </PropertyGroup>

    3. modify vsixmanifest file like this:

    <?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="VSIXProject3.leo.9dfe1eb8-314c-4fa1-a176-7a865703aa45" Version="1.0" Language="en-US" Publisher="leo" />
        <DisplayName>VSIXProject3</DisplayName>
        <Description>Empty VSIX Project.</Description>
      </Metadata>
      <Installation>
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="14.0" />
        <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="15.0" />
      </Installation>
      <Prerequisites>
        <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
        <Prerequisite Id="Microsoft.VisualStudio.Component.Web" Version="[15.0,16.0)" DisplayName="Web development tools" />
      </Prerequisites>
      <!--<Dependencies>
        <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
        <Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" d:Source="Installed" Version="[14.0]" />
      </Dependencies>-->
      <Assets>
        <Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
        <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
      </Assets>
      <!--<Assets>
        <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
      </Assets>-->
    </PackageManifest>
    

    For the complete demo, please download the demo as below.

    https://1drv.ms/u/s!AlvaNEnglADDgQawIOMZLO-HIT-T

    Best regards,

    Cole Wu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Friday, April 21, 2017 1:25 AM
  • Thnks, for the project it works fine!

    It seems like our difference is that I was targeting .NET4.5. 

    Friday, April 21, 2017 2:21 AM