Extends Microsoft.VSSDK.BuildTools so you can use SDK style projects for your Visual Studio Extension.
- Ensure your VSIX project uses the latest tools: Writing Visual Studio Extensions with Mads - Upgrading an old extension
- Migrate your VSIX project to the SDK style project format. (e.g. using Project Migration Helper).
In this state your project will build the binaries, but does not generate the
.vsix
container.
- 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)' != ''" />
- 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 useVersion="|%CurrentProject%;GetVsixVersion|"
in your manifest file.Turn of the target by setting the property
<SkipVsixGetVersionTarget>
totrue
:
<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>
totrue