aspnetcore: Conflicting assets with the same target path after upgrading Blazor from .net 5 to .net 6

I have spent a long time trying to figure what is the problem, looking for similar issues, but just could not find the answer.

Describe the bug

I have Blazor WASM hosted, with a couple of Razor Class Libraries which uses Shared project which references some .net framework library CIBWM.Markets.FxF.Adapters.FxSales.Contracts. There are no multiple runnable wasm clients so I have no idea what is causing this problem.

What I did

Just switched Blazor Client and Blazor Server from .net5.0 to .net6.0, upgrade nugget packages

Exceptions (if any)

Conflicting assets with the same target path ‘_framework/CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb’. For ‘Build’ assets ‘Identity: C:\Users\ab017jh\Source\Repos\fxonfront\src\FxSalesBlazorWasm\FxSalesBlazor.Client\bin\Debug\wwwroot_framework\CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb, SourceType: Computed, SourceId: FxSalesBlazor.Client, ContentRoot: C:\Users\ab017jh\Source\Repos\fxonfront\src\FxSalesBlazorWasm\FxSalesBlazor.Client\bin\Debug\wwwroot, BasePath: lol, RelativePath: _framework/CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb, AssetKind: Build, AssetMode: All, AssetRole: Primary, RelatedAsset: , AssetTraitName: BlazorWebAssemblyResource, AssetTraitValue: symbol, CopyToOutputDirectory: PreserveNewest, CopyToPublishDirectory: Never, OriginalItemSpec: C:\Users\ab017jh\Source\Repos\fxonfront\src\FxSales\Application.Common.Interfaces\bin\Debug\CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb’ and ‘Identity: C:\Users\ab017jh\Source\Repos\fxonfront\src\FxSalesBlazorWasm\FxSalesBlazor.Client\bin\Debug\wwwroot_framework\CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb, SourceType: Computed, SourceId: FxSalesBlazor.Client, ContentRoot: C:\Users\ab017jh\Source\Repos\fxonfront\src\FxSalesBlazorWasm\FxSalesBlazor.Client\bin\Debug\wwwroot, BasePath: lol, RelativePath: _framework/CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb, AssetKind: Build, AssetMode: All, AssetRole: Primary, RelatedAsset: , AssetTraitName: BlazorWebAssemblyResource, AssetTraitValue: symbol, CopyToOutputDirectory: PreserveNewest, CopyToPublishDirectory: Never, OriginalItemSpec: C:\Users\ab017jh\Source\Repos\fxonfront\src\FxSales\Application.Common.Interfaces\bin\Debug\CIBWM.Markets.FxF.Adapters.FxSales.Contracts.pdb’. FxSalesBlazor.Client C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets 411

Further technical details

  • visual studio 2022
dotnet --info Output
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19042
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  3.1.102 [C:\Program Files\dotnet\sdk]
  5.0.401 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

Thanks for contacting us.

We’re moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it’s very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

Issue can be manifested easily in two steps (VS 2022, .NET 6):

  1. Create blazor wasm hosted project with individual accounts.
  2. In Server project -> Add -> New Scaffolded Item -> Identity -> Add -> Overwrite All files => Select DbContext -> Add.

Try to rebuild -> Conflicting assets error.