Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit cc4292a

Browse files
committed
Add target for including NuGet packages in VSIX
Add IncludeNuGetPackageReferences target for including System.ValueTuple.dll and Newtonsoft.Json.dll in the VSIX.
1 parent d18f2b3 commit cc4292a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@
180180
<CustomToolNamespace>GitHub.VisualStudio.Settings</CustomToolNamespace>
181181
<LastGenOutput>PackageSettingsGen.cs</LastGenOutput>
182182
</Content>
183-
<Content Include="..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll">
184-
<Link>System.ValueTuple.dll</Link>
185-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
186-
<IncludeInVSIX>true</IncludeInVSIX>
187-
</Content>
188183
<None Include="packages.config">
189184
<SubType>Designer</SubType>
190185
</None>
@@ -427,6 +422,13 @@
427422
<PropertyGroup>
428423
<UseCodebase>true</UseCodebase>
429424
</PropertyGroup>
425+
<!-- Include required NuGet dependencies-->
426+
<Target Name="IncludeNuGetPackageReferences" AfterTargets="GetVsixSourceItems">
427+
<ItemGroup>
428+
<VSIXSourceItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'System.ValueTuple'" />
429+
<VSIXSourceItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Newtonsoft.Json'" />
430+
</ItemGroup>
431+
</Target>
430432
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
431433
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != '' And '$(NCrunch)' != '1'" />
432434
<Import Project="packaging.targets" />

0 commit comments

Comments
 (0)