Skip to content

Publishing blazor project fails with: An element with the same key was already inserted #91196

@sevinul

Description

@sevinul

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This is the standard blazor project template expanded by a class library containing four resource files in a localization folder. The project compiles and runs fine. On publishing it throws an error:

System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt. bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) bei System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) bei Microsoft.NET.Sdk.WebAssembly.ComputeWasmPublishAssets.GroupExistingStaticWebAssets(Dictionary2 assemblyAssets, Dictionary2 nativeAssets, Dictionary2 satelliteAssemblyAssets, Dictionary2 symbolAssets, Dictionary2 compressedRepresentations) bei Microsoft.NET.Sdk.WebAssembly.ComputeWasmPublishAssets.Execute() Mp3_Search.Blazor.App

Translation from German: An element with the same key was already inserted

From the error log:
System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Fehler beim Erstellen. Weitere Details finden Sie im Ausgabefenster. --- Ende der internen Ausnahmestapelüberwachung --- ---> (Interne Ausnahme #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Fehler beim Erstellen. Weitere Details finden Sie im Ausgabefenster.<---

Expected Behavior

The project should publish correctly.

Steps To Reproduce

Rebuild and publish the github template project: https://github.com/sevinul/BlazorApp1

Exceptions (if any)

See in bug description.

.NET Version

8.0.100-preview.7.23376.3

Anything else?

Microsoft Visual Studio Version 17.8.0 Preview 1.0
Windows 11 Version 22H2 (Build 22621.2215)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions