简体   繁体   English

如何正确部署 Blazor WASM(托管)应用程序?

[英]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.

相关问题 已发布托管 Blazor wasm 应用程序仅显示正在加载 - Published hosted Blazor wasm app only shows Loading 是否可以将环境变量从主机传递到托管的 blazor wasm 应用程序? - Is it possible to pass environment variables from the host to a hosted blazor wasm app? 在红隼中托管 blazor wasm asp.net 核心托管应用 - Hosting blazor wasm asp.net core hosted app in kestrel 如何发布 Blazor-Wasm 托管到本地 IIS - How to publish Blazor-Wasm Hosted to local IIS 有多个项目时,如何正确发布 ASP.NET Core 托管的 Blazor 应用程序? - How to correctly publish an ASP.NET Core hosted Blazor app when having multiple projects? 在Ubuntu上部署Web API + Blazor WASM WASM的完整性问题 - Deploy Web API + Blazor WASM on Ubuntu. Integrity issue of WASM Blazor WASM 托管如何在客户端页面中列出所有身份用户? - Blazor WASM hosted how can I list all Identity Users in a Client page? 在 Blazor WebAssembly 解决方案中,如何在与服务器 API 不同的端口上托管 Blazor WASM 客户端应用程序 - In Blazor WebAssembly solution, how to host the Blazor WASM client app on a different port to the server API Blazor wasm 托管应用程序与公司 AD windows 身份验证 - Blazor wasm hosted application with company AD windows authentication Blazor WASM 托管 - 在 API 上授权始终返回未经授权 - Blazor WASM Hosted - Authorize on API Always returns UnAuthorized
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM