无法运行已发布的 Blazor WebAssembly 应用程序 [英] Can't run published Blazor WebAssembly app
问题描述
当我在 Visual Studio 调试器中运行该应用程序时,它运行良好,但如果我将它部署到服务器,我会在浏览器控制台中收到此错误:
The app works just fine when I run it in the Visual Studio debugger, but if I deploy it to a server I get this error in the browser console:
未能在资源 'http://example.com/pwaexperiment/wwwroot/_framework/wasm/dotnet.3.2.0.js' 与计算的 SHA-256 完整性 '80L/hSwps3gjABzV78X6mehoDDgsLkm1pKpSS6fAqiE='.该资源已被阻止.
Failed to find a valid digest in the 'integrity' attribute for resource 'http://example.com/pwaexperiment/wwwroot/_framework/wasm/dotnet.3.2.0.js' with computed SHA-256 integrity '80L/hSwps3gjABzV78X6mehoDDgsLkm1pKpSS6fAqiE='. The resource has been blocked.
这个错误是什么意思,我该如何解决?
What does this error mean and how can I fix it?
推荐答案
尝试将以下标签添加到您的项目中:
Try adding the following tag to your project:
<BlazorCacheBootResources>false</BlazorCacheBootResources>
参考:https://github.com/dotnet/aspnetcore/issues/24505#issuecomment-684857753
这篇关于无法运行已发布的 Blazor WebAssembly 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!