Skip to content

error MSB4018: The "DiscoverPrecompressedAssets" task failed unexpectedly. An item with the same key has already been added #62251

Closed
@dotfede

Description

@dotfede

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

After upgrading to .NET SDK 9.0.3, I keep getting this error when building both blazor and aspnet core projects containing static assets such as html or css files. This happens when building from the command line as well as in Visual Studio 2022.

Seems to be the same as: #59476

Deleting obj folder and rebuilding via dotnet build works, but it is extremely annoying.

Expected Behavior

Build should succeed normally.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

9.0.300

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions