3
votes

My Blazor projects uses a Razor Class Library. After updating Blazor from 3.2.0 preview to 3.2.0 I'm getting:

Duplicate base paths '/' for content root paths

The error also shows paths including

...\bin\Debug\netstandard2.1\wwwroot\

I upgraded both the Blazor project and the razor lib from:

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0-preview3.20168.3" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0-preview3.20168.3" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0-preview3.20168.3" PrivateAssets="all" />
  </ItemGroup>

To

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" />
  </ItemGroup>

It is still working, when I publish my Razor library to Azure DevOps and include it in my Blazor project with Nuget. It only fails when I add & reference the project. It used to work in both cases.

2
if it works as nuget then its a bug you can report for blazorNick Kovalsky

2 Answers

2
votes

I had to remove all the WebAssembly stuff from my Razor class library:

Working:

<ItemGroup>
       <PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.3" />
       <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.3" />
</ItemGroup>

Credit goes to Jan-Willem Spuij @jspuij

1
votes

While upgrading my Blazor ASP.NET hosted web app, I accidentally installed web assembly DLLs to my server project. The solution for me was to remove all Microsoft.AspNetCore.Components.WebAssembly.* packages from server project.