3

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.

1
  • if it works as nuget then its a bug you can report for blazor Commented Jul 20, 2020 at 15:50

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.