Search code examples
nugetvisual-studio-extensionspackagereference

VSIX - Include PackageReference output groups


Currently we reference another project in the following way in order to include it completely in the VSIX package.

    <ProjectReference Include="....csproj">
      <Project>{8da36305-5468-465a-bf37-d87936b776d2}</Project>
      <Name>ProjectName</Name>
      <VSIXSubPath>SubDirectory</VSIXSubPath>
      <IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3bDocumentationProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
      <IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
    </ProjectReference>

This was working perfectly, until we have converted our 'old' Nuget references to the new PackageReference format. What we see is that the output files of the package references are not included in the VSIX package anymore. Is there an additional output group that we can include to solve this?


Solution

  • Can be solved by adding "ReferenceCopyLocalPathsOutputGroup" to IncludeOutputGroupsInVSIX. Found it here: https://github.com/dotnet/msbuild/issues/3069

    <ProjectReference Include="....csproj">
      <Project>{8da36305-5468-465a-bf37-d87936b776d2}</Project>
      <Name>ProjectName</Name>
      <VSIXSubPath>SubDirectory</VSIXSubPath>
      <IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3bDocumentationProjectOutputGroup%3bReferenceCopyLocalPathsOutputGroup%3b</IncludeOutputGroupsInVSIX>
      <IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
    </ProjectReference>