Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Microsoft.AspNetCore.App.Internal.Assets from being restored when not needed #46165

Open
mthalman opened this issue Jan 21, 2025 · 3 comments
Labels
Area-WebSDK untriaged Request triage from a team member

Comments

@mthalman
Copy link
Member

When running dotnet publish with self-contained deployment on a plain old web app, it causes the Microsoft.AspNetCore.App.Internal.Assets package to be restored from nuget.org even though that package isn't actually used by the deployed app it's not Blazor). This should be avoided because it's problematic when using a source built .NET SDK (see #46055 (comment)).

Repro steps:

  1. Install a CentOS Stream 9 source built .NET 10 SDK
  2. dotnet new webapp
  3. dotnet publish --self-contained true -r centos.9-x64

This was found when attempting to enable the self-contained tests for the VMR: #46055

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-WebSDK untriaged Request triage from a team member labels Jan 21, 2025
@ViktorHofer
Copy link
Member

ViktorHofer commented Jan 21, 2025

cc @javiercn @MackinnonBuck

@tmds
Copy link
Member

tmds commented Jan 22, 2025

Per @maraf's comment the package dependency is added based on UsingMicrosoftNETSdkRazor.

UsingMicrosoftNETSdkRazor is currently set on any ASP.NET Core project through the Microsoft.NET.Sdk.Web SDK.

Since this is a non source-buildable dependency which doesn't ship with a source-build SDK, we want to minimize the projects that depend on it.

cc @omajid

@MichaelSimons
Copy link
Member

@javiercn, can you provide some guidance or refer to someone who can? TIA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-WebSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants