Visual Studio reverts changes #1560

Closed
opened 2025-08-09 17:20:36 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @ManuelDeLeon on 6/15/2016

This happens in dev & prod modes. To reproduce:

  1. Create an Angular 2 project
  2. Open the .xproj file with Visual Studio (I'm using 2015)
  3. Kick off dotnet run
  4. Open http://localhost:5000 on a browser (preferably Chrome as it tends to work better with HMR).
  5. Using Visual Studio modify a file, say home.html from Hello, World to Hello, Everyone

Now 2 things will happen.

  1. HMR does't work.
  2. When you refresh the page it will flash Hello, Everyone for a split of a sec and then go back to Hello, World
  3. If you restart the server (on the console) and refresh the page you'll get the right value; but then further changes are discarded (as before).

This doesn't happen if you use Visual Studio Code (or any other editor for that matter). So if you close Visual Studio, terminate the server on the console, start the server again (dotnet run), open the page on Chrome, and then modify home.html, HMR works (the page is immediately updated) and refreshing the page will display the right text.

Any ideas why Visual Studio is messing things up?

*Originally created by @ManuelDeLeon on 6/15/2016* This happens in dev & prod modes. To reproduce: 1. Create an Angular 2 project 2. Open the `.xproj` file with Visual Studio (I'm using 2015) 3. Kick off `dotnet run` 4. Open `http://localhost:5000` on a browser (preferably Chrome as it tends to work better with HMR). 5. Using Visual Studio modify a file, say `home.html` from `Hello, World` to `Hello, Everyone` Now 2 things will happen. 1. HMR does't work. 2. When you refresh the page it will flash `Hello, Everyone` for a split of a sec and then go back to `Hello, World` 3. If you restart the server (on the console) and refresh the page you'll get the right value; but then further changes are discarded (as before). This doesn't happen if you use Visual Studio Code (or any other editor for that matter). So if you close Visual Studio, terminate the server on the console, start the server again (`dotnet run`), open the page on Chrome, and then modify `home.html`, HMR works (the page is immediately updated) and refreshing the page will display the right text. Any ideas why Visual Studio is messing things up?
fergalmoran added the waitingbugbugbug labels 2025-08-09 17:20:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1560
No description provided.