LibMan runs before dependent project targets
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
- 35/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, tooling
Hướng nghiên cứu
Reproduce the failure with the linked example, focusing on ProjectA's libman.json, ProjectA.csproj, and ProjectB's RunLBeforeBuildStepgen target. Inspect the LibraryManager build integration around LibraryManagerRestore and compare its ordering with referenced-project targets. Done means the generated Localizations.js is available before filesystem provider resolution without manually building ProjectB.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
ProjectB generates files in a Target
<Target Name="RunLBeforeBuildStepgen" BeforeTargets="BeforeBuild" >
<Message Text="=== Generating localizations ===" Importance="high" />
<WriteLinesToFile File="Localizations.js" Lines="Localization data generated before build." />
</Target>
ProjectA have this in its libman.json
{
"version": "1.0",
"defaultProvider": "filesystem",
"libraries": [
{
"library": "../../ProjectB/",
"files": [ "Localizations.js" ],
"destination": "wwwroot/assets/l10n/"
}
]
}
dotnet build .\ProjectA\ProjectA\ProjectA.csproj fails:
Restore complete (0.3s)
info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
ProjectA net8.0 failed with 2 error(s) (0.1s)
D:\Nuget\microsoft.web.librarymanager.build\3.0.71\build\Microsoft.Web.LibraryManager.Build.targets(35,9): error
System.AggregateException: One or more errors occurred. (The "../../ProjectB/" library could not be resolved by th
e "filesystem" provider)
---> Microsoft.Web.LibraryManager.Contracts.InvalidLibraryException: The "../../ProjectB/" library could not be r
esolved by the "filesystem" provider
at Microsoft.Web.LibraryManager.Providers.FileSystem.FileSystemProvider.GetStreamAsync(ILibraryInstallationStat
e state, String file, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.Web.LibraryManager.Providers.FileSystem.FileSystemProvider.<>c__DisplayClass9_1.<InstallAsync>b__0
()
at Microsoft.Web.LibraryManager.Build.Contracts.HostInteraction.WriteFileAsync(String path, Func`1 content, ILi
braryInstallationState state, CancellationToken cancellationToken)
at Microsoft.Web.LibraryManager.Providers.FileSystem.FileSystemProvider.InstallAsync(ILibraryInstallationState
desiredState, CancellationToken cancellationToken)
libman.json : error LIB000: An unknown exception occurred
https://github.com/aspnet/LibraryManager/issues/642 describes a similar problem. But in my case its a target in a referenced project. And yes, also tried BeforeTargets="LibraryManagerRestore"
Created a little repo https://github.com/AlexanderRydberg/LibraryManagerTargetIssue
Expected behavior
Targets in referenced project being run before libman.
Is this behavior by design?
Any suggestions on how I could solve this without:
manually building ProjectB first and then ProjectA
or
Copy Target from ProjectB to ProjectA's csproj and have BeforeTargets="LibraryManagerRestore"
- 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 ·
-
Add NPM as a provider Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
aspnet/LibraryManager#807 · 3 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 ·