Why aren't props and targets in my package working properly? #11253
Open
Description
I created a package with custom props and targets following this link. But when I tried to add some properties it didn't work properly.
- I added ContinuousIntegrationBuild to props according to this link. Because I use lock file. But ContinuousIntegrationBuild is not set even though GITHUB_ACTIONS property is set.
- I tried adding the following to targets:
<PropertyGroup Condition="'$(GeneratePackageOnBuild)' == 'true'">
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnablePackageValidation>true</EnablePackageValidation>
</PropertyGroup>
But it doesn't work. So I had to add it to Directory.Build.targets in all my NuGet package solutions.
3. I tried to set IsAotCompatible
for NuGet packages. That property and its dependent properties (IsTrimmable, etc.) were set correctly. However, IsTrimmable was not set in the assemblies I built.
<PropertyGroup Condition="'$(GeneratePackageOnBuild)' == 'true' and ('$(OutputType)' == '' or '$(OutputType)' == 'Library')">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
According to the link I mentioned earlier, "There are a few things that must not be done in packages' .props and .targets, such as not specifying properties and items that affect restore, as those will be automatically excluded." But it doesn't seem to me that these cases are like that.
Metadata
Assignees
Labels
No labels
Activity