Skip to content

Extends Microsoft.VSSDK.BuildTools so you can use SDK style projects for your Visual Studio Extension.

License

Notifications You must be signed in to change notification settings

tom-englert/VSIX-SdkProjectAdapter

Repository files navigation

VSIX-SdkProjectAdapter

Build Status NuGet Status

Extends Microsoft.VSSDK.BuildTools so you can use SDK style projects for your Visual Studio Extension.


Preparation

Usage

  • Add a PackageReference to VSIX-SdkProjectAdapter
  • Remove the import to Microsoft.VsSDK.targets from your project:
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />

Features

  • These properties are set by default, so you don't have to include them in your project:
<PropertyGroup>
  <UseCodebase Condition="'$(UseCodebase)'==''">true</UseCodebase>
  <VSCTResourceName Condition="'$(VSCTResourceName)'==''">Menus.ctmenu</VSCTResourceName>
</PropertyGroup>
  • The VSPackage resources and corresponding .vsct files are automatically included, so you don't have to include them in your project:
<ItemGroup Condition="'$(SkipVSIXDefaults)'!='true' AND 'EnableDefaultItems'!='false'">

  <None Update="**\*.vsixmanifest">
    <SubType>Designer</SubType>
  </None>

  <!-- Neutral VSPackage resources -->
  <EmbeddedResource Update="VSPackage.resx">
    <MergeWithCTO>true</MergeWithCTO>
    <ManifestResourceName>VSPackage</ManifestResourceName>
  </EmbeddedResource>

  <!-- Localized VSPackage resources -->
  <EmbeddedResource Update="VSPackage.*.resx">
    <MergeWithCTO>true</MergeWithCTO>
    <LogicalName>%(FileName).resources</LogicalName>
    <DependentUpon>VSPackage.resx</DependentUpon>
  </EmbeddedResource>

  <_VSCTLocalizedFiles Include="*.*.vsct" />
  <_VSCTNeutralFile Include="*.vsct" Exclude="@(_VSCTLocalizedFiles)"/>

  <!-- Neutral .vsct file, only include if there are no localized files -->
  <VSCTCompile Include="@(_VSCTNeutralFile)" Condition="@(_VSCTLocalizedFiles->'%(Identity)')==''">
    <ResourceName>$(VSCTResourceName)</ResourceName>
    <SubType>Designer</SubType>
  </VSCTCompile>

  <!-- Localized .vsct files -->
  <VSCTCompile Include="@(_VSCTLocalizedFiles)">
    <ResourceName>$(VSCTResourceName)</ResourceName>
    <SubType>Designer</SubType>
    <DependentUpon>@(_VSCTNeutralFile)</DependentUpon>
  </VSCTCompile>

</ItemGroup>
  • Provides a build target to set the version in your source.extension.manifest file; just use Version="|%CurrentProject%;GetVsixVersion|" in your manifest file.

    Turn of the target by setting the property <SkipVsixGetVersionTarget> to true:

  <Target Name="GetVsixVersion" Returns="$(VsixVersion)" Condition="'$(SkipVsixGetVersionTarget)'!='true' AND '$(SkipVSIXDefaults)'!='true'">
    <PropertyGroup>
      <VsixVersion Condition="'$(VsixVersion)' == ''">$(Version)</VsixVersion>
    </PropertyGroup>
  </Target>  
  • Disable all features at once by setting the property <SkipVSIXDefaults> to true

About

Extends Microsoft.VSSDK.BuildTools so you can use SDK style projects for your Visual Studio Extension.

Resources

License

Stars

Watchers

Forks

Packages