Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Content files added by the package do not provide NuGetPackageId metadata #3108

Open
kzu opened this issue Feb 21, 2025 · 0 comments · May be fixed by #3109
Open

[Bug]: Content files added by the package do not provide NuGetPackageId metadata #3108

kzu opened this issue Feb 21, 2025 · 0 comments · May be fixed by #3109

Comments

@kzu
Copy link

kzu commented Feb 21, 2025

Version

1.50.0

Steps to reproduce

The targets file includes content items in the consuming project.

If you install (for example) System.Diagnostics.DiagnosticSource (v9, say), you will notice that the content item it provides to the consuming project, is included by nuget as follows in the project's obj\[projectname].nuget.g.props:

  <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
    <Content Include="$(NuGetPackageRoot)system.diagnostics.diagnosticsource\9.0.2\contentFiles\any\net8.0\ILLink\ILLink.Descriptors.LibraryBuild.xml" Condition="Exists('$(NuGetPackageRoot)system.diagnostics.diagnosticsource\9.0.2\contentFiles\any\net8.0\ILLink\ILLink.Descriptors.LibraryBuild.xml')">
      <NuGetPackageId>System.Diagnostics.DiagnosticSource</NuGetPackageId>
      <NuGetPackageVersion>9.0.2</NuGetPackageVersion>
      <NuGetItemType>Content</NuGetItemType>
      <Pack>false</Pack>
      <Private>False</Private>
      <Link>ILLink\ILLink.Descriptors.LibraryBuild.xml</Link>
    </Content>
  </ItemGroup>

This convention allows the consumer's custom targets to act and extend the build as needed by checking (at a minimum) the NuGetPackageId to see what items are being included by which packages.

Since Playwright is not using the default mechanism for content files inclusion, this metadata is missing, making it impossible for consumers to detect these items in a reliable way.

Expected behavior

I expect the content items to at least contain the NuGetPackageId metadata, and optionally the NuGetPackageVersion.

Actual behavior

No NuGet-related metadata is provided.

Additional context

No response

Environment

- .NET Version (TFM): net8.0/9.0
kzu added a commit to kzu/playwright-dotnet that referenced this issue Feb 21, 2025
…adata

This aligns the items with the built-in mechanism in nuget for providing content items, and enables reliable detection of these items in consuming projects.

Fixes microsoft#3108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant