Skip to content

Why aren't props and targets in my package working properly? #11253

Open
@na1307

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.

  1. 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.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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