Skip to content

[Hot Reload with dotnet watch][Unstable] Create a 11.0 Blazor Web App project, update and save the .css file, and then refresh the browser, the project will revert to its previous state #66089

@EmilyFeng97

Description

@EmilyFeng97

REGRESSION INFO Works well in 10.0.201 and 10.0.300-preview SDK
Also repro in .NET 11.0 preview 1 SDK

INSTALL STEPS

  1. Clean Win11 x64 25h2 ENU
  2. Install the .NET 11.0 preview 2 SDK from corhont build
  3. Add feed

Platform

  • Windows
  • macOS
  • Linux

Repro Steps

  1. Open a normal Command Prompt
  2. Create a Blazor Web App for Server project, and run it using dotnet watch
    dotnet new blazor -int Server -o MyBlazorServerApp
    cd MyBlazorServerApp
    dotnet watch
    
  3. Press Ctrl + C to stop the dotnet watch
  4. Then run it using dotnet watch again
  5. Open Components/Layout/MainLayout.razor.css in Notepad, update the .page selector:
       .page {
           position: relative;
           display: flex;
           flex-direction: column;
      +   background-color: orange;
    
  6. Save the change, the browser update to display the color
  7. Refresh the browser, view the browser

Actual Result
The page will return to the previous state after refresh the browser.

Image

Note:

  1. This issue doesn't repro with 10.0.201 SDK(March Servicing build) and 10.0.300-preview build.
  2. This issue doesn't repro Blazor WebAssembly Standalone project.
  3. This issue also repro on Blazor web app for Wasm project.
  4. This issue also repro on wwwroot/app.css file, does not repro on .razor file.

Error Log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions