I am interested in using custom elements as a means of strangling a legacy ASP.NET MVC website so that I can gradually port it to Blazor. However apart from the official documents,
Note: For more details you can have a look our official document here.
In addition, for asp.net core and blazor server and web assembly app integration you could check these official document that might be resourceful.
CodePudding user response:
You are missing some steps:
You have to publish the blazor wasm stand-alone project to generate the bin folder.
Copy the bin/xx/net7.0 subfolders to the old app on the root of your content folder (_framework, _content, etc)
On your old app you have to add some lines to the html layout to load the blazor component (also resources if needed (css/js/etc)):
<script src="_framework/blazor.webassembly.js"></script> <script src="_content/Microsoft.AspNetCore.Components.CustomElements/BlazorCustomElements.js"></script>
Must been added before the html body end
There is another option to use Blazor without using web component as I explain in the following link