Skip to content

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

@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

Activity

added
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
on Jun 4, 2025
martincostello

martincostello commented on Jun 4, 2025

@martincostello
Member

Duplicate of dotnet/sdk#49180.

added
area-blazorIncludes: Blazor, Razor Components
and removed
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
on Jun 4, 2025
dotnet-policy-service

dotnet-policy-service commented on Jun 5, 2025

@dotnet-policy-service
Contributor

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @martincostello@dotfede

        Issue actions

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