有没有办法从 MVC 应用程序中的特定控制器操作为 Blazor 应用程序提供服务? [英] Is there a way to serve a Blazor app from a specific controller action in a MVC app?

查看:17
本文介绍了有没有办法从 MVC 应用程序中的特定控制器操作为 Blazor 应用程序提供服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在现有的 ASP.NET Core 3.0 MVC 项目中设置一个控制器操作来为 Blazor 应用提供服务.过去我看到过与其他 SPA 框架类似的东西,操作的视图只包含包含包的脚本标签,通常还有一些其他设置,例如将 SPA 构建放在 wwwroot 上以用于 MVC 项目.

I'd like to set up a controller action in a already existing ASP.NET Core 3.0 MVC project to serve a Blazor app. I've seen something similar with other SPA frameworks in the past, the View for the action just includes contains the script tag with the bundle, there's usually some other setup like having the SPA build placed on wwwroot for the MVC project.

查看 Blazor 应用程序,它似乎在某种程度上类似,其中 index.html 文件包含 wasm 脚本.但老实说,我不确定从哪里开始设置它.有什么想法吗?

Looking at the Blazor app it seems similar to some extent, where the index.html file includes the wasm script. But I'm honestly not sure where to start to set it up. Any ideas?

推荐答案

似乎您正在使用 Blazor 客户端.基本上,Blazor 客户端应用程序的条目是加载blazor.webassembly.js

相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆