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

Set copyOnly on static resources in Blazor templates #33808

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

captainsafia
Copy link
Member

Fixes #33738.

Due to a downstream bug (see dotnet/templating#3325), the templating engine can copy malformed versions of static assets, like images or styles, to the app repo. As a result, fonts/styles/etc won't appear on the functional application without replacing these assets with working versions.

The workaround is to use the copyOnly property to indicate that the assets should be copied without modification.

Also, this change isn't just a workaround for the problem at hand. It's the right thing to do for assets that don't need to run through the templating engines variable replacement in order to function. We already do this for wwwroot in other templates but missed it in Blazor somewhow.

@captainsafia captainsafia requested a review from a team as a code owner June 24, 2021 15:41
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Jun 24, 2021
@captainsafia captainsafia added area-blazor Includes: Blazor, Razor Components and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Jun 24, 2021
@pranavkm
Copy link
Contributor

@captainsafia do you have a PR targeting p6?

Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent - thanks for tracking this down!

@captainsafia
Copy link
Member Author

@pranavkm I'm gonna use the backport bot thing.

@captainsafia
Copy link
Member Author

/backport to release/6.0-preview6

@github-actions
Copy link
Contributor

Started backporting to release/6.0-preview6: https://github.com/dotnet/aspnetcore/actions/runs/968574978

@captainsafia captainsafia enabled auto-merge (squash) June 24, 2021 16:17
@captainsafia captainsafia merged commit c8d548c into main Jun 24, 2021
@captainsafia captainsafia deleted the safia/fix-templates branch June 24, 2021 17:04
@ghost ghost added this to the 6.0-preview7 milestone Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blazor Server template open-iconic issues
3 participants