question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update to SDK 2.2.100 throws "An item with the same key has already been added. Key: .wasm"

See original GitHub issue

I updated my Blazor project from 2.2.100-preview3-009430 to 2.2.100 release. I now get the following exception:

System.ArgumentException : An item with the same key has already been added. Key: .wasm
Stack Trace:
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Microsoft.AspNetCore.Builder.BlazorApplicationBuilderExtensions.CreateContentTypeProvider(Boolean enableDebugging)
   at Microsoft.AspNetCore.Builder.BlazorApplicationBuilderExtensions.UseBlazor(IApplicationBuilder app, BlazorOptions options)
   at Microsoft.AspNetCore.Builder.ServerSideBlazorApplicationBuilderExtensions.UseServerSideBlazor[TStartup](IApplicationBuilder builder)
   at OpenGraphTilemaker.Web.Server.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in C:\Users\flynn\Projects\OpenGraphTilemaker\src\OpenGraphTilemaker.Web.Server\Startup.cs:line 36
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.TestHost.TestServer..ctor(IWebHostBuilder builder, IFeatureCollection featureCollection)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateServer(IWebHostBuilder builder)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.EnsureServer()
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateDefaultClient(DelegatingHandler[] handlers)
   at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateClient(WebApplicationFactoryClientOptions options)
   at OpenGraphTilemaker.Web.Client.Tests.FunctionalTests.Get_EndpointsReturnSuccessAndCorrectContentType(String url) in C:\Users\flynn\Projects\OpenGraphTilemaker\tests\OpenGraphTilemaker.Web.Client.Tests\FunctionalTests.cs:line 25
--- End of stack trace from previous location where exception was thrown ---

The line app.UseServerSideBlazor<Client.Startup>(); seems to be the reason.

Any suggestions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:26 (8 by maintainers)

github_iconTop GitHub Comments

9reactions
danroth27commented, Dec 10, 2018

Thanks everyone for reporting this issue! I apologize for the inconvenience.

To workaround this issue you will need to have your Blazor projects continue to target .NET Core 2.1 (netcoreapp2.1). We aren’t planning to patch this issue because there is a workaround and we are currently focused on getting Razor Components into .NET Core 3.0. This issue will be fixed once we release the first public preview of Razor Components early next year.

8reactions
isaacrlevincommented, Dec 12, 2018

@danroth27 So to summarize, there is currently no support for Blazor on .NET Core 2.2?

Read more comments on GitHub >

github_iconTop Results From Across the Web

An item with the same key has already been added
I had a duplicate property with the same name in my ViewModel. One Property was in BaseViewModel and another is in derived Model....
Read more >
Blazor error - Radzen IDE (Angular)
Update to SDK 2.2.100 throws "An item with the same key has already been added. Key: .wasm" ... I updated my Blazor project...
Read more >
Error "An item with the same key has already been added"
This article helps to fix the error "An item with the same key has already been added". Applies to: Windows Server 2012 R2...
Read more >
The current .NET SDK does not support targeting . ...
I have the same problem when trying to install OrchardCore.Application.Cms.Targets in my ASP.net core 2.2 project. After I updated Visual ...
Read more >
The Obligatory "How I Upgraded To .NET Core 3.1" Post
NET Core 2.2 or 3.0, now is the time to upgrade. I went through it, and although ... In addition, since the project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found