Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

LibMan installed libraries are not picked up by MapStaticAssets

未关闭
#799 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp
领域
build-system

调研方向

Start with the csproj integration using Microsoft.Web.LibraryManager.Build, especially the LibraryManagerRestore target and the static web assets targets named in the report. Reproduce with dotnet publish and inspect the generated PROJECTNAME.staticwebassets.endpoints.json. Done means libraries restored into wwwroot/lib appear in that manifest even when the folder did not exist before the build.

由索引模型根据 Issue 内容生成。

描述

Describe the bug

When using .NET 9's MapStaticAssets, existing assets in wwroot are picked up and compressed during build.
However, using Microsoft.Web.LibraryManager.Build, the libraries installed via libman in wwwroot/lib are not picked up.
I've tried numerous combinations of adding a target that tries to trigger the LibraryManagerRestore target before various other targets that sound like they are looking for assets (like ResolveStaticWebAssetsInputs or ResolveProjectStaticWebAssets) but none of that seems to work.

To Reproduce

Steps to reproduce the behavior:

  1. Create a csproj that uses the ASP.NET web SDK with library manager (including Microsoft.Web.LibraryManager.Build) and restores libraries using libman into wwwroot/lib
  2. run dotnet publish --configuration release --output ./dist
  3. Check the generated static web assets file in the output (cat dist/PROJECTNAME.staticwebassets.endpoints.json)
  4. Find that it does not contain any files that were restored by libman in wwwroot/lib
Expected behavior

LibMan restored files are included in the static web assets manifest.

Additional context

Note that this is rather hard to reproduce in an IDE, since it will usually automatically restore the libman libraries.
If the wwwroot/lib folder exists BEFORE the build is started, it is also correctly picked up by the static web assets tooling.
We've hit the problem during CI builds.

dotnet --version: 9.0.305
Microsoft.Web.LibraryManager.Build: 3.0.71

主要语言
C#
星标
486
派生
91
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aspnet/LibraryManager 的其他 Issue

查看 aspnet/LibraryManager 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。