I recently updated the .NET version and the VS version to 9.0 and I'm getting this error:
The "DefineStaticWebAssetEndpoints" task failed unexpectedly.System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssetEndpoints.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26. MoveNext()
I tried these steps:
- Looked for multiple entries that refer to the same file in
.csproj - Clean the build, cache and ran the project again.
- Restarted Visual Studio
I am new to .NET and looking for an answer for this issue.