Skip to content

AssignTargetPathsDependsOn overridden by default value #1558

@AbubakerB

Description

@AbubakerB

I have a targets file that i was using on a net452 class library. After converting the classlib to netstandard20, the Target in my targets file wasn't being applied.

This is my targets file:

<Project> <ItemGroup> <AvailableItemName Include="CustomContent" /> </ItemGroup> <ItemGroup> <None Remove="src\*.json" /> </ItemGroup> <ItemGroup> <CustomContent Include="src\*.json" > <CopyToOutputDirectory>Always</CopyToOutputDirectory> </CustomContent> </ItemGroup> <PropertyGroup> <AssignTargetPathsDependsOn> $(AssignTargetPathsDependsOn); IncludeCustomContent; </AssignTargetPathsDependsOn> </PropertyGroup> <Target Name="IncludeCustomContent"> <CreateItem Include="@(CustomContent)" AdditionalMetadata="TargetPath=$(AssemblyName)\%(relativedir)%(Filename)%(Extension)"> <Output ItemName="ContentWithTargetPath" TaskParameter="Include" /> </CreateItem> </Target> </Project>

This targets file is imported into my netstandard20 classlib.

I ran dotnet build -v d > d_log.txt and it's output suggested:
Property reassignment: $(AssignTargetPathsDependsOn)="" (previous value: "IncludeCustomContent").

Seems like it's being overridden by the default value in Microsoft.Common.CurrentVersion.targets

  1. Has something changed in this sdk?
  2. I noticed that the AvailableItemName value doesn't show up on the "Build Action" dropdownlist in the file property dialog (for a netstandard project) in VS (15.3.2). Is AvailableItemName still supported?
  3. The .json files disappear from the project's solution explorer when using <CustomContent Include="src\*.json" >. When i use <Content Include="src\*.json" > they show up again. Is this intentional?

Note, i also tried this with Content instead of CustomContent and, although it showed up in the solution explorer, it still didn't work (my IncludeCustomContent Target was not ran)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions