Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

RCL + Libman: Restored files don't get packed / published at the correct location in final app.

Abierto
#634 4 comentarios 4 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
build-system

Línea de trabajo

Start with the ResolveCurrentProjectStaticWebAssetsInputs and LibraryManagerRestore targets described in the issue, and compare the pack and publish flows through the dotnet CLI and Visual Studio. Done means LibMan-restored files from an RCL are placed under wwwroot/_content// on the first pack or publish, without requiring a prior restore.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Copy from the original issue I filed in the AspNet.Core repo:
https://github.com/dotnet/aspnetcore/issues/34039

Describe the bug

Files that are restored with the Microsoft.Web.LibraryManager.Build (LibMan) inside a Razor Class Library (RCL) are not deployed to the correct location in the final consuming app (e.g. Blazor Server App).
Instead of being deployed to:
wwwroot/_content/<RCL Package Name>/
they are deployed to
wwwroot/

This happens only if the files are not yet restored when you pack / publish the app. Once the files are restore they are correctly deployed in subsequent builds.

dotnet version:
5.0.300
environments:
dotnet cli (e.g. dotnet pack)
Visual Studio (pack context menu)

Solution

I found out that the ResolveCurrentProjectStaticWebAssetsInputs target takes content files as its input. The LibraryManagerRestore on the other hand doesn't produce content items. If you apply the following workaround, the issue disappears:

...
  <PropertyGroup>

<ResolveCurrentProjectStaticWebAssetsInputsDependsOn>LibraryManagerRestore;FixLibManRestore;$(ResolveCurrentProjectStaticWebAssetsInputsDependsOn)</ResolveCurrentProjectStaticWebAssetsInputsDependsOn>

  </PropertyGroup>
  
  <Target Name="FixLibManRestore" AfterTargets="LibraryManagerRestore">
  <ItemGroup>
            <Content  Include="%(FilesForPackagingFromProject.Identity)" Exclude="@(Content)">
            </Content>
        </ItemGroup>
		
  </Target>

...

Lenguaje dominante
C#
Estrellas
486
Forks
92
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de aspnet/LibraryManager

Todos los issues de aspnet/LibraryManager

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.