Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • daniel 4 posts 24 karma points
    Jan 05, 2022 @ 22:24
    daniel
    0

    Blazor site mixed with Umbraco site

    I have an existing Blazor site that is fairly large, about 100,000 lines of code.

    I would like to tack Umbraco onto this site to be the home page and a few folders with SEO relevant articles in these folders.

    I have no need for the Blazor code and the Umbraco code to ever simultaneously serve content.

    I currently have no Umbraco project, though I have played around with it.

    Is there a way I can add Umbraco to my visual studio project and then twiddle the routing so that it works as Umbraco for some URL's and as Blazor for the others?

    If not, how may I add an Umbraco site to my existing dot net core 5 Blazor app?

    thanks, and much appreciated

  • Corné Hoskam 81 posts 588 karma points MVP 3x c-trib
    Jan 06, 2022 @ 14:25
    Corné Hoskam
    0

    Hi Daniel,

    What kind of hosting model of Blazor are we talking about, Blazor Server-Side or Blazor WebAssembly?

    If we're talking Blazor Server-Side, and you wish to fully integrate all of your Server-Side pages into Umbraco, you would indeed be able to install Umbraco into your existing Blazor application, and then configure the routing/endpoints so that a specific set of endpoints wouldn't lead to Umbraco, but to your Blazor application instead.

    If we're talking Blazor WebAssembly, sadly there is no way to fully integrate the two projects. You can however overwrite specific routes on your Umbraco application so that instead of Umbraco handling the requests in it's pipelines, it simply serves/redirects to the Blazor WebAssembly files instead, as long as these two projects don't interconnect!

    I hope this helped,

    Kind regards,

    Corné Hoskam

  • daniel 4 posts 24 karma points
    Jan 06, 2022 @ 15:14
    daniel
    0

    thank you!

    Yes, it is Blazor Server side. Good to know it is possible to set it up this way.
    I have a couple of questions about how to do it.

    I have not been able to install the required Umbraco 9 into an existing project because all directions on installing it are into a new project, and using the command line.

    do I need to have it in the same project, or is there a way of doing it as a separate project?

    When I search on Nuget, UmbracoCMS 9 does not show up as an option.

    Second question. Do you know of any links that explain how to setup the routing once it is installed in the same project/solution?

  • Corné Hoskam 81 posts 588 karma points MVP 3x c-trib
    Jan 06, 2022 @ 16:03
    Corné Hoskam
    0

    The easiest way from an Umbraco perspective would be to indeed create an new Umbraco project and then add your code onto that, but if you already have an existing project with quite a large codebase, adding the Umbraco.Cms package to it (https://www.nuget.org/packages/umbraco.cms/) should also work just fine!

    Depending on the complexity of your already existing project, it might be best for you to determine whether you want to add merge the two projects together by adding Umbraco to your existing project, or to have them separate. I don't think I have any links available for routing specifically for separating Umbraco & Blazor Server-Side, but perhaps one of my recent blog posts can be of use to you, in which I do the reverse as you, by adding Blazor Server-Side into an Umbraco 9 application!

    https://cornehoskam.com/posts/how-to-use-server-side-blazor-with-umbraco-9-live-notifications

Please Sign in or register to post replies

Write your reply to:

Draft