'Static styles.css issues after renaming Blazor project

If I start a Blazor server from scratch. Then right-click the project and click rename.

All the namespaces change(EditedProjectName.Pages) but the using statements keep the old references(OriginalProjectName.Pages).

This is fairly easy to overcome with Find and replace OriginalProjectName.Pages => replace with => EditedProjectName.Pages

Now the issue. Seemly randomly the site launches without proper css. The same output as I get if I comment out the static CSS in {PROJECT NAME}.styles.css which makes the sidebar etc disappear incorrect blazor index page view

Any idea of how the project name change can cause this issue and how I can solve or troubleshoot it?



Solution 1:[1]

The issue disappeared when I did a Build|Clean and a Build|Rebuild.

Solution 2:[2]

When you rename a Blazor project, be sure to rename also the Razor CSS file bundle, referenced in

/Pages/_Layout.cshtml

as

<!-- Important: these are the razor css'es built at runtime -->
<link href="[Your_Project_Name].styles.css" rel="stylesheet" />

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 WorldNeedsRefactoring
Solution 2 Guildenstern70