-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
⌚ Not TriagedSource - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcmapQuestclean moveclean movemigration/subsvcseQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.
Description
Description
We should add migration steps to this doc that describe how to update an existing ASP.NET Core app to use MapStaticAssets in .NET 9. Note that this is an optional step and is not required to update to .NET 9, but it does enable new functionality and benefits.
- Replace
UseStaticFileswithMapStaticAssetsin Program.cs - In Blazor Web Apps apps
- Update explicit references to static assets in .razor files to use the
@Assets["asset-path"]API- Note, this should not be done for the Blazor framework scripts (blazor.*.js)
- Update your root App.razor component to include the
<ImportMap />component in the head
- Update explicit references to static assets in .razor files to use the
- In MVC & Razor Pages based apps
- Chain a call to
.WithStaticAssets()afterMapRazorPagesorMapControllerRoutein Program.cs - Add
<script type="importmap"></script>to the head of the main layout
- Chain a call to
@javiercn Anything else?
Page URL
https://learn.microsoft.com/en-us/aspnet/core/migration/80-90?view=aspnetcore-8.0&tabs=visual-studio
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/migration/80-90.md
Document ID
ff7b9e49-f8a8-552a-e27e-c604c858b318
Article author
Metadata
Metadata
Assignees
Labels
⌚ Not TriagedSource - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcmapQuestclean moveclean movemigration/subsvcseQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.