Closed AbubakerB closed 7 years ago
I suspect in your previous, "classic" csproj file, this was below the import of Microsoft.Common.targets
? This allowed re-assigning the property after it has been set by the common targets.
There are two workarounds:
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<!-- All your project's other content here -->
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<AssignTargetPathsDependsOn>
$(AssignTargetPathsDependsOn);
IncludeCustomContent;
</AssignTargetPathsDependsOn>
</PropertyGroup>
</Project>
Create a Directory.Build.targets
file containing the reassignment:
<Project>
<PropertyGroup>
<AssignTargetPathsDependsOn>
$(AssignTargetPathsDependsOn);
IncludeCustomContent;
</AssignTargetPathsDependsOn>
</PropertyGroup>
<!-- you could also put the target here to keep the main project file cleaner -->
</Project>
This file is automatically imported by the common targets late enough to reassign the property.
this was below the import of Microsoft.Common.targets?
yep, my bad 😄
Unfortunately, I dont have access to the classlib (its managed by someone else). I could ask them to manually add these things in, but it doesn't seem like the best approach.
Also, does this explain why AvailableItemName
isn't working anymore?
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:
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
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). IsAvailableItemName
still supported?<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 ofCustomContent
and, although it showed up in the solution explorer, it still didn't work (myIncludeCustomContent Target
was not ran)