【发布时间】: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