Theme styling not working with multiple wwwroot

Having a solution with a couple projects, A and B, where both have a wwwroot folder, so project A references project B and gets all it’s shared code/components. Radzen Blazor Studio doesn’t like that and tries to update the theme files on project B (which wouldn’t be a massive problem for us), but then also when changing the theme appearance it cannot update the “app.css” file. Doesn’t show up on either of the projects.

Deleting the wwwroot folder on project B and loading the solution again allows Radzen Blazor Studio to work as intended, is there a solution for this?

Hi @asilva,

Can you tell us what the Sdk attributes of the <Project> elements of both csproj files are? Radzen Blazor Studio should ignore class libraries when it comes to wwwroot location. A class library usually has

<Project Sdk="Microsoft.NET.Sdk.Razor">

whereas the actual web app could be:

<Project Sdk="Microsoft.NET.Sdk.Web">

or

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

In any case you could share the actual app with us on info@radzen.com and we will investigate.

Hi, thank you for the quick response.

Project B is set with

<Project Sdk="Microsoft.NET.Sdk.Razor">

and project A with

<Project Sdk="Microsoft.NET.Sdk.Web">

Unfortunately I cannot share this project.

Then we will need additional info so we can reproduce it locally.

  1. What rendering mode does the "main" project use (the one with Sdk="Microsoft.NET.Sdk.Web") - you can get that from Program.cs
  2. Target frameworks of both projects.
  3. What file is the app css stored in and in which project?
  4. How do you register the theme in the main project?

UPDATE:

Is the class library before the main app - this could also break the ordering.

  1. builder.Services.AddRazorComponents()
           .AddInteractiveServerComponents();
    
  2. They both target .net10

  3. The app.css is in the wwwroot folder for project A, just on the top level

  4. In the App.razor file:

<head>
    <RadzenTheme Theme="fluent" />
  ...
</head>

...

</html>

When you say before is this about the list of projects in the solution?

If so, yes project B shows up before project A

That's probably the cause of the issue. We have incorporated a fix which should hopefully address the problem. The fix will be released tomorrow.

Thank you for the quick help, I will be looking out for the update and let you know if the issue still persists