Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

{"An item with the same key has already been added. Key: /Index.razor"} #21

Open
Levvy055 opened this issue Dec 2, 2020 · 1 comment

Comments

@Levvy055
Copy link

Levvy055 commented Dec 2, 2020

When starting Blazor Server-based project got following error with stacktrace:

   at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException[T](T key)
   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 RazorComponentsPreview.TestRazorProjectFileSystem.Add(RazorProjectItem item)
   at RazorComponentsPreview.Generator.Add(String filePath, String content)
   at RazorComponentsPreview.RuntimeComponentsGenerator..ctor(IServiceCollection serviceCollection)
   at RazorComponentsPreview.RazorRuntimeCompilationExtensions.UseRazorComponentsRuntimeCompilation(IApplicationBuilder app)
   at Tori.Web.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, DbContextOptions`1 identityDbContextOptions, IOptions`1 operationalStoreOptions, UserManager`1 userManager, RoleManager`1 roleManager) in S:\Kod\W\Blazor.Web\Startup.cs:line 86
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.<StartAsync>d__31.MoveNext()
@ennerperez
Copy link

Multiples files with same name in different folders, the build index using file name instead some kind of unique identifier.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants