Skip to content

CopyToOutputDirectory stopped working #4494

@adrianvmsft

Description

@adrianvmsft

Steps to reproduce

  1. Enlist into this repo: https://github.com/Microsoft/VSProjectSystem/
  2. Open in Visual Studio 2019
    samples/CpsExtension/CpsExtension.sln
  3. In Solution Explorer, build CpsExtension.Vsix

Expected behavior

CustomDebugger.xaml file to be copied to this folder:
CpsExtension.Vsix\bin\Debug\net461\BuildSystem\Rules\CustomDebugger.xaml

Actual behavior

it doesn't get copied

Project file

<Project>

  <!-- Set these early for VSSDK to work -->
  <PropertyGroup>
    <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
    <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
    <BaseOutputPath>$(MSBuildThisFileDirectory)bin\</BaseOutputPath>
    <BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\</BaseIntermediateOutputPath>
    <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
    <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
    <RootNamespace>CpsExtension</RootNamespace>
  </PropertyGroup>

  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />

  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
    <GeneratePkgDefFile>false</GeneratePkgDefFile>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Sdk" Version="15.8.243" />
    <PackageReference Include="Microsoft.VSSDK.BuildTools" Version="15.8.3247" />
  </ItemGroup>

  <ItemGroup>
    <None Remove="BuildSystem\Rules\**" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="BuildSystem\**" Exclude="**\*.cs;**\*.xaml">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <ItemGroup>
    <VSIXSourceItem Include="BuildSystem\**" Exclude="**\*.cs">
      <InstallRoot>MSBuild</InstallRoot>
      <VSIXSubPath>Microsoft\VisualStudio\v15.0\CpsExtension\%(RelativeDir)</VSIXSubPath>
      <Visible>false</Visible>
    </VSIXSourceItem>
  </ItemGroup>

  <ItemGroup>
    <XamlPropertyRule Include="BuildSystem\Rules\*.xaml" Namespace="$(RootNamespace).Rules">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </XamlPropertyRule>
  </ItemGroup>

  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
  <Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets')" />

</Project>

MSBuild version: 16.200.19

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions