dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.21k stars 9.95k forks source link

GenerateStaticWebAssetEndpointsManifest - An Item with the same key has already been added #57992

Open vsfeedback opened 2 hours ago

vsfeedback commented 2 hours ago

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version] [regression] [worked-in:17.11.3] Updated to the Latest Visual Studio Version 17.12.0 Preview 2.0, Blazor WASM App that is still building as .net 8 no longer builds... Nothing changed other than updating to get .net 9 installed.

I then performed a Full Repair using Visual Studio Installer for both installed versions Version 17.12.0 Preview 2.0 Version 17.11.3

Application Builds and Runs on Version 17.11.3, but doesn't build on Preview 2 version.

Error:

ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAssetEndpointsManifest.Execute()

When I click to Show the error source. the following is shown

<GenerateStaticWebAssetEndpointsManifest
   Source="$(PackageId)"
   ManifestType="Build"
   Assets="@(StaticWebAsset)"
   Endpoints="@(StaticWebAssetEndpoint)"
   ManifestPath="$(StaticWebAssetEndpointsBuildManifestPath)">
 </GenerateStaticWebAssetEndpointsManifest>

I did double check and the Assets.targets file doesn't have a second header called GenerateStaticWebAssetEndpointsManifest and I've never changed this file...


Original Comments

Feedback Bot on 9/17/2024, 06:17 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

martincostello commented 2 hours ago

Might be a duplicate of https://github.com/dotnet/aspnetcore/issues/57512.