Go to file
Pranav K b34c5ddd5f
Prevent dotnet-watch script injection staleness (#27778)
The browser refresh mechansim used by dotnet-watch and VS modifies HTML content. The modified content includes
a script block that has a WebSocket url that changes for each new execution of dotnet watch run (not rebuilds, but watch itself).
HTML content can come from views or static html files on disk. For the latter, ASP.NET Core participates in browser caching by sending (and invalidating) etag headers.

One way to fix this problem is remove or modify the etag headers. The risk here is that might cause differences in behavior in development users may come to rely on that are unavailable in production. This change instead modifies the HTML content so the output is always consistent and consequently safe to cache. The dynamic content is served separately by the injected middleware.

This change fixes the issue of multiple instances of dotnet-watch. While this issue may crop up if you alternate between dotnet run and dotnet watch run but we haven't seen this being an issue as yet.

Fixes #27548

Summary
Running dotnet watch run multiple times in Blazor WASM apps (or any app that serves static html files) can produce console errors and prevent the browser refresh feature from working. Given that we've been telling our users to use dotnet watch run as their primary way to work outside of VS, it's likely more users would run in this.

Customer impact
A hard browser refresh (Ctrl + R) is needed to get the refresh behavior to work.

Regression
No. This has existed since the feature was introduced we did not get reports of it

Risk
Low. The fix is isolated to dotnet-watch and VS's browser refresh mechanism which is in preview. The change was tested locally, but if there's a regression or if the change interferes with user's workflow, users have the ability to disable this feature.
2020-11-13 14:25:47 -08:00
.azure/pipelines Don't push to VS feed when post build sign == true (#27265) 2020-11-10 12:35:49 -08:00
.config Update dependencies from https://github.com/dotnet/efcore build 20201110.8 (#27708) 2020-11-11 06:20:15 +00:00
.github React to runtime release branch rename (#25026) 2020-08-19 01:25:51 +00:00
.vscode Quarantined flaky RazorSDK tests (#22553) 2020-06-04 22:24:23 +00:00
docs Fix invalid Build command (#24771) 2020-08-11 18:27:46 +00:00
eng [release/5.0] Update dependencies from dotnet/efcore (#27789) 2020-11-13 18:50:44 +00:00
src Prevent dotnet-watch script injection staleness (#27778) 2020-11-13 14:25:47 -08:00
.editorconfig Enable FxCop Analyzers for the repo (#23709) 2020-07-08 15:26:22 -07:00
.gitattributes Update .gitattributes to include jQuery files (#20537) 2020-06-17 06:17:29 -07:00
.gitignore Adding reference to MessagePackAnalyzer to check for MsgPack001 / MsgPack002 (Banned API) (#19989) 2020-03-19 16:05:45 -07:00
.gitmodules
.vsconfig Add .vsconfig files in root and beside slns 2020-03-31 14:25:44 -07:00
AspNetCore.sln Remove Microsoft.Components.Web.Extensions (#26256) (#26298) 2020-09-25 12:14:56 -07:00
CODE-OF-CONDUCT.md Link Code of Conduct 2020-04-02 19:51:30 -07:00
CONTRIBUTING.md More updates docs (#20513) 2020-04-03 22:09:36 +00:00
Directory.Build.props [release/5.0] Update API baseline files (#27653) 2020-11-12 10:28:52 -08:00
Directory.Build.targets [release/5.0] Update API baseline files (#27653) 2020-11-12 10:28:52 -08:00
LICENSE.txt
NuGet.config [release/5.0] Update dependencies from dotnet/efcore (#27789) 2020-11-13 18:50:44 +00:00
README.md Added the link to the IssueManagementPolicies document (#24591) 2020-08-05 15:03:59 -07:00
SECURITY.md Add link to new MSRC portal (#19236) 2020-02-25 22:52:03 +00:00
THIRD-PARTY-NOTICES.txt Add Swashbuckle to Third-Party-Notices.txt (#26012) 2020-09-17 13:19:55 -07:00
activate.ps1
activate.sh
build.cmd
build.ps1 Enable ARM64 installers build. (#25579) 2020-09-10 10:59:37 -07:00
build.sh Enable `/warnAsError` (#23072) 2020-06-18 15:59:34 -07:00
clean.cmd
clean.ps1
clean.sh
dockerbuild.sh Pass through BUILD_REPOSITORY_NAME to docker containers (#25620) 2020-09-04 10:07:31 -07:00
global.json [release/5.0] Update dependencies from dotnet/arcade (#27683) 2020-11-12 19:46:20 +00:00
restore.cmd
restore.sh
startvs.cmd

README.md

ASP.NET Core

ASP.NET Core is an open-source and cross-platform framework for building modern cloud based internet connected applications, such as web apps, IoT apps and mobile backends. ASP.NET Core apps run on .NET Core, a free, cross-platform and open-source application runtime. It was architected to provide an optimized development framework for apps that are deployed to the cloud or run on-premises. It consists of modular components with minimal overhead, so you retain flexibility while constructing your solutions. You can develop and run your ASP.NET Core apps cross-platform on Windows, Mac and Linux. Learn more about ASP.NET Core.

Get Started

Follow the Getting Started instructions in the ASP.NET Core docs.

Also check out the .NET Homepage for released versions of .NET, getting started guides, and learning resources.

See the Triage Process document for more information on how we handle incoming issues.

How to Engage, Contribute, and Give Feedback

Some of the best ways to contribute are to try things out, file issues, join in design conversations, and make pull-requests.

Reporting security issues and bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

These are some other repos for related projects:

Code of conduct

See CODE-OF-CONDUCT