[英]How to correctly deploy Blazor WASM (hosted) app?
I'm pretty new to programming and I'm having a hard time deploying my app.我对编程很陌生,我很难部署我的应用程序。 I published the server to the folder.我将服务器发布到该文件夹。 Using FTP I pushed it to the server, and set the domain to look for the app on../server/wwwroot.使用 FTP 我将其推送到服务器,并设置域以在../server/wwwroot 上查找应用程序。 App runs fine until I try to do API/server call, it returns error 404. Also at the start of the app, there is a warning "Streaming compilation failed. Falling back to ArrayBuffer instantiation. TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'."应用程序运行良好,直到我尝试执行 API/服务器调用,它返回错误 404。同样在应用程序启动时,有一个警告“流式编译失败。回退到 ArrayBuffer 实例化。TypeError:无法执行“编译” “WebAssembly”:响应 MIME 类型不正确。应为“应用程序/wasm”。”
On the side note, this same app works when published directly to Azure from Visual Studio.在旁注中,当从 Visual Studio 直接发布到 Azure 时,同样的应用程序可以工作。
So my question is, what am I doing wrong?所以我的问题是,我做错了什么?
Are you hosting it as a Static Web App?您是否将其托管为 Static Web 应用程序?
Normally you would hook it up to its Github repository and take it from there.通常,您会将其连接到其 Github 存储库并从那里获取。 Make sure you have a valid Azure plan (student/pay as you go) that goes along with it.确保您有一个有效的 Azure 计划(学生/随用随付)。
You could also check out Kudu on Azure as it'll tell you what went wrong, check the logs there under D:\home\LogFiles>
您还可以在 Azure 上查看 Kudu,因为它会告诉您出了什么问题,请查看D:\home\LogFiles>
下的日志
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.