Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

LibMan runs before dependent project targets

オープン
#808 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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"

主要言語
C#
スター
486
フォーク
91
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aspnet/LibraryManager のほかの issue

aspnet/LibraryManager の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。