【问题标题】:How to fix Refused to load the script 'https://localhost:5001/_framework/aspnetcore-browser-refresh.js'如何修复拒绝加载脚本'https://localhost:5001/_framework/aspnetcore-browser-refresh.js'
【发布时间】:2021-11-12 17:47:24
【问题描述】:

我在 .NET 版本 5.0.401 上使用 ASP.NET Core 5 版本 5.0.10。 错误信息

Refused to load the script 'https://localhost:5001/_framework/aspnetcore-browser-refresh.js' because it violates the following Content Security Policy directive: "script-src 'sha256-fa5rxHhZ799izGRP38+h4ud5QXNT0SFaFlh4eqDumBI='". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

如何解决?

【问题讨论】:

  • 尝试清除浏览器缓存:开发工具中的应用程序/存储/“清除站点数据”
  • 我试过了,问题没有改变。
  • 你能分享一下你包含它的脚本标签吗?另外,你 100% 确定 sha 字符串是正确的吗?
  • 我在源代码中看不到,它是由 ASP.NET Core Blazor 生成的。
  • 你可以在谷歌搜索这个字符串sha256-fa5rxHhZ799izGRP38+h4ud5QXNT0SFaFlh4eqDumBI=

标签: .net asp.net-core blazor .net-5 blazor-webassembly


【解决方案1】:

这似乎是一个热重载问题。问题正在GitHub跟踪

【讨论】:

  • 感谢您的信息。
猜你喜欢
  • 2021-08-15
  • 1970-01-01
  • 2021-08-21
  • 1970-01-01
  • 2021-03-07
  • 1970-01-01
  • 2018-10-12
  • 2015-04-21
  • 1970-01-01
相关资源
最近更新 更多