[Blazor] libman libraries not included in first build
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start with the referenced Microsoft.NET.Sdk.Publish.ComputeFiles.targets target and compare it with the Blazor MAUI build using the provided binlogs. Reproduce with the csproj, libman.json, and index.html steps, then verify that a clean first build includes the generated library files without requiring a second build.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue moved from dotnet/maui#6709
- Please respond to @campersau.
From @campersau on Saturday, April 30, 2022 6:31:24 PM
Description
Adding some client javascript libraries via libman does not include them in the first build.
When comparing the binlog with a blazor wasm build I can see that there is a _IncludePrePublishGeneratedContent target which is not present in the blazor maui build and thus any files which are generated under the wwwroot folder during the build are missing.
Here are the binlogs:
blazorbinlogs.zip
I only tested windows.
Steps to Reproduce
- New Blazor Maui App
- Add
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.161" PrivateAssets="all" />to thecsproj - Add
libman.jsonwith the following content:
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "twitter-bootstrap@5.1.3",
"files": [
"css/bootstrap.min.css"
],
"destination": "wwwroot/libs/bootstrap"
}
]
}
- Update
index.htmland reference<link rel="stylesheet" href="libs/bootstrap/css/bootstrap.min.css" />instead. - Remove the
wwwroot/libsfolder and do a new build / run. This will add thelibsfolder back but the app does include the CSS file. If you run the app again without removing thewwwroot/libsfolder the CSS is included correctly.
It would be great if the libman library files were included directly in the first build.
Alternatively you can clone https://github.com/campersau/blazor-maui-libmanbug and do step 5.
Version with bug
Release Candidate 2 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net6.0-windows10.0.19041.0
Did you find any workaround?
Building the project a second time works correctly as the libraries are already restored.
Or copy the msbuild target from https://github.com/dotnet/sdk/blob/c53c8ac81e1bcb8118c31bc4f5622396c72e9959/src/WebSdk/Publish/Targets/ComputeTargets/Microsoft.NET.Sdk.Publish.ComputeFiles.targets#L48-L60 into the csproj.
<Target Name="_IncludePrePublishGeneratedContent" BeforeTargets="GetCopyToPublishDirectoryItems" Condition=" '$(EnableDefaultItems)' == 'true' And '$(EnableDefaultContentItems)' == 'true' ">
<ItemGroup>
<!-- First, clean up previously generated content that may have been removed. -->
<ContentWithTargetPath Remove="@(ContentWithTargetPath)" Condition="!Exists('%(Identity)')" />
<!-- Next, include any newly generated content. -->
<_WebProjectGeneratedContent Include="wwwroot\**" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(_ContentIncludedByDefault)" />
<ContentWithTargetPath Include="@(_WebProjectGeneratedContent)" TargetPath="%(Identity)" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
</Target>
Relevant log output
No response
- Ngôn ngữ chính
- C#
- Star
- 486
- Fork
- 91
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aspnet/LibraryManager
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aspnet/LibraryManager#824 · 1 bình luận · 3 reaction ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
aspnet/LibraryManager#804 · 2 reaction ·
-
Changelog for 3.0.114 Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 48/100
aspnet/LibraryManager#829 · 1 bình luận · 3 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
aspnet/LibraryManager#820 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aspnet/LibraryManager#808 · 5 bình luận ·
Tất cả issue của aspnet/LibraryManager
Issue tương tự
-
CS0162 "Unreachable code detected" warning from a MSBuildTemp .tmp file in every game project Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/vscode-azurefunctions#5197 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
microsoft/microsoft-ui-reactor#1274 ·