Take the community feedback survey now.

New .Net8 CMS Solution Integrating Blazor Server

Vote:
 

Hi Everyone,

I am trying to create a new solution using .Net8 and Blazor server however i am struggling to integrate it into CMS. I have started with the Episerver.Empty template, set up blazor server and made sure that there are no connection errors by checking the network tab in developer tools. I can see it rendering my static component made with blazor correctly however when i navigate to /episerver/cms, it loses connection with the solution. I have tried it multiple ways however i just cannot get it to connect to CMS after integrating the blazor server. 

I am just wondering if anyone else has created a new web solution recently with Blazor server? if so,

  • What nuget packages and versions are you using?
  • What Middleware are you using?
  • What is your service configuration?

Also, the episerver.empty template uses a startup.cs file however when I ask AI, it says that this is an old way of configuring solutions and that the code should now be factored into the program.cs file. Has anyone tried doing this and if so, have you encountered any issues?

I am new to blazor and dont have a lot of experience in back end development however I understand how to create the models, cshtml views and razor components to make page and block templates in CMS. Once I get to that stage, as the site is mainly static, I feel I should be able to set up the rest of the site fairly easily, just setting up new templates for the site editors.

Any advice given would be appreiciated

Thanks 

Chris

#339596
Edited, Jul 04, 2025 16:00
Vote:
 

Hello Chris,

The recent emergence of minimalistic APIs is not something I'm a fan of.  It really clashes against SOLID prinicpals and structured code for long living applications that may be managed by multiple team members.

The single program.cs is great if your building a small API, microservice or you're prototyping as it means less files.  In these scenarios the APIs are typically simple and this makes understanding code easier.

In larger applications with complex controllers and a larger code base and long term maintenance concerns where structured code matters, then the separate program.cs / startup.ConfigureServices(...) / startup.Configure(...) is the better way to go.  This allows you to separate your code into Hosting, Configuration, Flow respectively.  It also avoids an excessive program.cs.

I would also recommend looking up the ServiceCollection Extensions pattern as this too can simplify your startup.

#339776
Jul 21, 2025 9:40
Chris Smith - Jul 21, 2025 9:48
Thanks for your update Mark. Its great to get feedback from other users
Mark Stott - Jul 21, 2025 10:26
You're welcome Chris :)
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.