Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Abp.AbpException: A dictionary can not contain same key twice. #8962


User avatar
0
peteras created

Hi,

after successful version update and successfull solution build I get bellow error when trying to run backend:

Abp.AbpException: A dictionary can not contain same key twice. There are some duplicated names: Price, IsActive, Value
   at Abp.Localization.Dictionaries.Xml.XmlLocalizationDictionary.BuildFomXmlString(String xmlString)
   at Abp.Localization.Dictionaries.Xml.XmlEmbeddedFileLocalizationDictionaryProvider.CreateXmlLocalizationDictionary(String xmlString)
   at Abp.Localization.Dictionaries.Xml.XmlEmbeddedFileLocalizationDictionaryProvider.InitializeDictionaries()
   at Abp.Localization.Dictionaries.LocalizationDictionaryProviderBase.Initialize(String sourceName)
   at Abp.Localization.MultiTenantLocalizationDictionaryProvider.Initialize(String sourceName)
   at Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver)
   at Abp.Localization.MultiTenantLocalizationSource.Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver)
   at Abp.Localization.LocalizationManager.InitializeSources()
   at Abp.Localization.LocalizationManager.Initialize()
   at Abp.AbpKernelModule.PostInitialize()
   at Abp.Modules.AbpModuleManager.<>c.<StartModules>b__15_2(AbpModuleInfo module)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Abp.Modules.AbpModuleManager.StartModules()
   at Abp.AbpBootstrapper.Initialize()
   at Abp.AspNetCore.AbpApplicationBuilderExtensions.InitializeAbp(IApplicationBuilder app)
   at Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbp(IApplicationBuilder app, Action`1 optionsAction)
   at MarketShake.Web.Startup.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) in D:\WORK\MarketShake\MarketShake_migrate\aspnet-core\src\MarketShake.Web.Host\Startup\Startup.cs:line 174
   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.&lt;&gt;c__DisplayClass4_0.&lt;Build&gt;b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.&lt;&gt;c__DisplayClass0_0.&lt;Configure&gt;g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.&lt;&gt;c__DisplayClass2_0.&lt;Configure&gt;b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String startupMessage)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String startupMessage)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
   at MarketShake.Web.Startup.Program.Main(String[] args) in D:\WORK\MarketShake\MarketShake_migrate\aspnet-core\src\MarketShake.Web.Host\Startup\Program.cs:line 12

I can not see where the problem is. Did you noticed similar error before? Since I am using fields like "Price, IsActive, Value" in my own tables I am not sure if this is casing my part or platform part ...

To explain the steps I have taken:

  1. Using initial version (5.6) of backend and make it master
  2. creating branches from master. Branch dev, migrate, aspnetzero
  3. checkout branch migrate and copy over version (5.6) in development and make commit. tray to build and run. it works
  4. checkout branch aspnetzero and copy over latest version (8.6) and make commit. I need to resolve some problems and errors but in the end clean version update works and run
  5. Checkout branch dev and migrate it with branch migrate. resolved conflicts commit and run - it worked
  6. Migrate branch aspnetzero and dev. resolved conflicts and some errors. commit, build and run and I get mentioned error

Thank you in advance for help.


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    There are some duplicated names: Price, IsActive, Value

    Can you check your xml file?

  • User Avatar
    0
    autumn created

    This is caused by duplicate keys in an xml languages file.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @petera did you solve this problem ?

  • User Avatar
    0
    peteras created

    Hi ismcagdas, thank you for suggestion - removing duplicates solved the problem. Thank you for your help