Internal Error SR.DuplicateKey

I am compiling a project with water (and the same happens with visual studio), and I get an Internal Error: System.ArgumentException: SR.DuplicateKey. I do not see what could be causing it. I turned the compile debug level upto diagnostics, and this is what I get:

"C:\Program Files (x86)\RemObjects Software\Elements\Bin\EBuild.exe" C:\source\NW2_Projects_Prism\NetWeaver2_WPF35.sln --logger:fire --configuration:Debug --no-goal --skip-projects:{95F6EB53-59F1-4454-8979-30CDB2ACBDB9};{796A7335-BAD9-424D-AB80-5EC4D03E687A};{CF1DE474-DFD5-4618-B835-35002C6B8F72};{CBB3F457-5DA6-4BD0-A45A-C0FBDC087716};{1BE27345-969F-487C-AD8C-94FECF196C73};{85042979-7851-4EBB-899C-47E5D39CC6B2} --verbosity:verbose --xml:C:\source\NW2_Projects_Prism\obj\NetWeaver2_WPF35.water.xml --rebuild --setting:TreatFixableErrorsAsWarnings=True
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2021. All Rights Reserved. Created by marc hoffman.
Version 11.0.0.2639 (develop) built on talax, 20210618-141548. Commit 6c3c9f1.

   -> Task RemObjects.EBuild.CleanSolution started.
      -> Project NetWeaver2_Engine started.
         -> Task RemObjects.EBuild.Elements.ElementsCleanProject started for NetWeaver2_Engine.
            -> Task RemObjects.EBuild.CleanProject started for NetWeaver2_Engine.
            <- Task RemObjects.EBuild.CleanProject finished for NetWeaver2_Engine, took 0.0010s (0.000s).
         <- Task RemObjects.EBuild.Elements.ElementsCleanProject finished for NetWeaver2_Engine, took 0.0000s (0.004s).
      <- Project NetWeaver2_Engine finished, took 0.004s.
      Project 'NetWeaver2_Engine' cleaned successfully.
      Solution 'NetWeaver2_WPF35' cleaned successfully.
   <- Task RemObjects.EBuild.CleanSolution finished for NetWeaver2_WPF35, took 0.0070s (0.007s).
   -> Task RemObjects.EBuild.BuildSolution started.
      -> Project NetWeaver2_Engine started.
         -> Task RemObjects.EBuild.Elements.ElementsBuildProject started for NetWeaver2_Engine.
            -> Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths started for NetWeaver2_Engine.
            <- Task RemObjects.EBuild.Elements.ElementsExpandCopyToOutputDirectoryPaths finished for NetWeaver2_Engine, took 0.0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings started for NetWeaver2_Engine, Echoes.
               Mapping DefineConstants=DEBUG;TRACE;PRISM;WPF35 to ConditionalDefines in Target Echoes
               Mapping AssemblyName=NetWeaver2_Engine to BinaryName in Target Echoes
               Mapping CpuType=anycpu to Architecture in Target Echoes
            <- Task RemObjects.EBuild.Elements.ElementsApplyLegacySettings finished for NetWeaver2_Engine, Echoes, took 0.0010s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsSanityCheck started for NetWeaver2_Engine, Echoes.
            <- Task RemObjects.EBuild.Elements.ElementsSanityCheck finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.000s).
            -> Task RemObjects.EBuild.Elements.ElementsPreparePlatforms started for NetWeaver2_Engine.
               Preparing target 'Echoes' (platform 'Echoes').
               -> Task RemObjects.EBuild.Elements.ElementsPreflightEchoes started for NetWeaver2_Engine.
                  Reference Assemblies base path is 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework',
                  Reference Assemblies path for .NET is 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework',
               <- Task RemObjects.EBuild.Elements.ElementsPreflightEchoes finished for NetWeaver2_Engine, took 0.0050s (0.005s).
               -> Task RemObjects.EBuild.Elements.ElementsPrepareEchoesPlatform started for NetWeaver2_Engine, Echoes.
                  Reference Assemblies path for .NETFramework is 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework',
               <- Task RemObjects.EBuild.Elements.ElementsPrepareEchoesPlatform finished for NetWeaver2_Engine, Echoes, took 0.0080s (0.012s).
            <- Task RemObjects.EBuild.Elements.ElementsPreparePlatforms finished for NetWeaver2_Engine, took 0.0130s (0.012s).
            -> Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles started for NetWeaver2_Engine, Echoes.
            <- Task RemObjects.EBuild.Elements.ElementsResolveSourceFiles finished for NetWeaver2_Engine, Echoes, took 0.0100s (0.010s).
            -> Task RemObjects.EBuild.Elements.ElementsPreCompile started for NetWeaver2_Engine, Echoes.
               -> Task RemObjects.EBuild.Elements.ElementsPreCompileEchoes started for NetWeaver2_Engine, Echoes.
                  -> Task RemObjects.EBuild.Elements.ElementsResolveContent started for NetWeaver2_Engine, Echoes.
                  <- Task RemObjects.EBuild.Elements.ElementsResolveContent finished for NetWeaver2_Engine, Echoes, took 0.0020s (0.001s).
                  -> Task RemObjects.EBuild.Elements.ElementsEchoesResolveXamlFiles started for NetWeaver2_Engine, Echoes.
                  <- Task RemObjects.EBuild.Elements.ElementsEchoesResolveXamlFiles finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.000s).
               <- Task RemObjects.EBuild.Elements.ElementsPreCompileEchoes finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.001s).
            <- Task RemObjects.EBuild.Elements.ElementsPreCompile finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.025s).
            -> Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences started for NetWeaver2_Engine.
            <- Task RemObjects.EBuild.Elements.ElementsCheckForTargetlessReferences finished for NetWeaver2_Engine, took 0.0010s (0.001s).
            -> Task RemObjects.EBuild.Elements.ElementsResolveReferences started for NetWeaver2_Engine.
               -> Target Echoes started.
                  -> Task RemObjects.EBuild.Elements.ElementsResolveEchoesReferencesForTarget started for NetWeaver2_Engine, Echoes.
                     -> Task RemObjects.EBuild.Elements.ElementsProcessNuGetReferences started for NetWeaver2_Engine, Echoes.
                     <- Task RemObjects.EBuild.Elements.ElementsProcessNuGetReferences finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.000s).
                     Reference 'mscorlib' was resolved to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\mscorlib.dll' for target 'Echoes'.
                     Added implicit reference to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\mscorlib.dll'
                     Reference 'System.Core' was resolved to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Core.dll' for target 'Echoes'.
                     Added implicit reference to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Core.dll'
                  <- Task RemObjects.EBuild.Elements.ElementsResolveEchoesReferencesForTarget finished for NetWeaver2_Engine, Echoes, took 0.0090s (0.008s).
               <- Target Echoes finished.
            <- Task RemObjects.EBuild.Elements.ElementsResolveReferences finished for NetWeaver2_Engine, took 0.0270s (0.028s).
            -> Task RemObjects.EBuild.Elements.ElementsPreCompile2 started for NetWeaver2_Engine, Echoes.
               -> Task RemObjects.EBuild.Elements.ElementsRunGenerators started for NetWeaver2_Engine, Echoes.
                  Object 'Properties\Settings.settings' already has a .Designer file.
               <- Task RemObjects.EBuild.Elements.ElementsRunGenerators finished for NetWeaver2_Engine, Echoes, took 0.0010s (0.001s).
               -> Task RemObjects.EBuild.Elements.ElementsPreCompile2Echoes started for NetWeaver2_Engine, Echoes.
               <- Task RemObjects.EBuild.Elements.ElementsPreCompile2Echoes finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.000s).
            <- Task RemObjects.EBuild.Elements.ElementsPreCompile2 finished for NetWeaver2_Engine, Echoes, took 0.0000s (0.001s).
            -> Task Compile started for NetWeaver2_Engine.
               Compiling target 'Echoes'
               -> Target Echoes started compiling.
                  Starting compile for NetWeaver2_Engine Echoes 
                  RemObjects Elements Compiler for .NET, Cocoa, Java and Island.
                  Copyright 2003-2021 RemObjects Software, LLC. All rights reserved. Created by Carlo Kok
                  Version 11.0.0.2639 (develop) built on talax, 20210618-141548. Commit 6c3c9f1.
                  Source file: C:\source\Common\AdoConnections.pas
                  Source file: C:\source\Common\Beej.inc
                  Source file: C:\source\Common\BeejApplicationAccess.pas
                  Source file: C:\source\Common\BeejColors.pas
                  Source file: C:\source\Common\BeejDbUtils.pas
                  Source file: C:\source\Common\BeejDialogs.pas
                  Source file: C:\source\Common\BeejDotNetDateUtils.pas
                  Source file: C:\source\Common\BeejDotNetResourceUtils.pas
                  Source file: C:\source\Common\BeejDotNetSysUtils.pas
                  Source file: C:\source\Common\BeejDotNetTStringList.pas
                  Source file: C:\source\Common\BeejFileStream.pas
                  Source file: C:\source\Common\BeejFileUtils.pas
                  Source file: C:\source\Common\BeejGenericLists.pas
                  Source file: C:\source\Common\BeejHttp.pas
                  Source file: C:\source\Common\BeejImageList.pas
                  Source file: C:\source\Common\BeejIniFiles.pas
                  Source file: C:\source\Common\BeejInternetUtils.pas
                  Source file: C:\source\Common\BeejJSON.pas
                  Source file: C:\source\Common\BeejLevenshteinDistance.pas
                  Source file: C:\source\Common\BeejLog.pas
                  Source file: C:\source\Common\BeejMathUtils.pas
                  Source file: C:\source\Common\BeejRuntimeDatabase.pas
                  Source file: C:\source\Common\BeejStream.pas
                  Source file: C:\source\Common\BeejStringUtils.pas
                  Source file: C:\source\Common\BeejTime.pas
                  Source file: C:\source\Common\BeejTranslatedText.pas
                  Source file: C:\source\Common\BeejTypes.pas
                  Source file: C:\source\Common\BeejXml.pas
                  Source file: C:\source\NW2_Projects_Prism\WPF35\NetWeaver2_Engine\DateStamp.pas
                  Source file: C:\source\NW2_Projects_Prism\WPF35\NetWeaver2_Engine\Properties\AssemblyInfo.pas
                  Source file: C:\source\NW2_Projects_Prism\WPF35\NetWeaver2_Engine\Properties\Settings.Designer.pas
                  Source file: C:\source\NWDotNetBase\LanguageController.pas
                  Source file: C:\source\NWEng\NWEng_Includes.inc
                  Source file: C:\source\NWEng\uNWEng_ActionController.pas
                  Source file: C:\source\NWEng\uNWEng_ArgNodes.pas
                  Source file: C:\source\NWEng\uNWEng_Callbacks.pas
                  Source file: C:\source\NWEng\uNWEng_Colors.pas
                  Source file: C:\source\NWEng\uNWEng_CompareNodes.pas
                  Source file: C:\source\NWEng\uNWEng_ConstantNodes.pas
                  Source file: C:\source\NWEng\uNWEng_Core.pas
                  Source file: C:\source\NWEng\uNWEng_CreateNode.pas
                  Source file: C:\source\NWEng\uNWEng_DataRowAdapter.pas
                  Source file: C:\source\NWEng\uNWEng_DbLink.pas
                  Source file: C:\source\NWEng\uNWEng_Exceptions.pas
                  Source file: C:\source\NWEng\uNWEng_FuzzyCurveNode.pas
                  Source file: C:\source\NWEng\uNWEng_GUID.pas
                  Source file: C:\source\NWEng\uNWEng_LegacyReadWrite.pas
                  Source file: C:\source\NWEng\uNWEng_LegacyStream.pas
                  Source file: C:\source\NWEng\uNWEng_LogicNodes.pas
                  Source file: C:\source\NWEng\uNWEng_MathNodes.pas
                  Source file: C:\source\NWEng\uNWEng_NodeCodes.pas
                  Source file: C:\source\NWEng\uNWEng_ProxyNodes.pas
                  Source file: C:\source\NWEng\uNWEng_Security.pas
                  Source file: C:\source\NWEng\uNWEng_Session.pas
                  Source file: C:\source\NWEng\uNWEng_Task.pas
                  Source file: C:\source\NWEng\uNWEng_Types.pas
                  Source file: C:\source\NWEng\uNWEng_Version.pas
                  Source file: C:\source\NWEng_EMDS\EMDS_API.pas
                  Source file: C:\source\NWEng_EMDS\uNWEng_EMDS_API.pas
                  Source file: C:\source\NWEng_EMDS\uNWEng_EMDS_BatchProcess.pas
                  Reference: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\mscorlib.dll
                  Reference: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Core.dll
                  Reference: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\RemObjects.Elements.Cirrus\v4.0_11.0.0.2639__3df3cad1b7aa5098\RemObjects.Elements.Cirrus.dll
E:                Internal error: System.ArgumentException: SR.DuplicateKey
   at System.Collections.Immutable.ImmutableDictionary`2.HashBucket.Add(TKey key, TValue value, IEqualityComparer`1 keyOnlyComparer, IEqualityComparer`1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result)
   at System.Collections.Immutable.ImmutableDictionary`2.Add(TKey key, TValue value, KeyCollisionBehavior behavior, MutationInput origin)
   at System.Collections.Immutable.ImmutableDictionary`2.Add(TKey key, TValue value)
   at RemObjects.Oxygene.Code.Compiler.Compiler.ResolveUsesFor(CodeFile aCodeFile, Boolean aEverything)
   at RemObjects.Oxygene.Code.Compiler.Compiler.GetNamespaceInfo(IHolderOfUses aUses, Boolean aEverything)
   at RemObjects.Oxygene.Code.Compiler.Compiler.GetNamespaceName(IHolderOfUses aUses)
   at RemObjects.Oxygene.Code.ElementsSyntaxModel.c()
   at System.Threading.Tasks.Task.Execute()
E:                Treat Warnings As Errors is enabled, and warnings occured
               <- Target Echoes failed compiling.
            <- Task Compile failed for NetWeaver2_Engine, took 0.5730s (0.628s).
         <- Task RemObjects.EBuild.Elements.ElementsBuildProject failed for NetWeaver2_Engine, took 0.0000s (0.628s).
      <- Project NetWeaver2_Engine failed, took 0.628s.
      Project 'NetWeaver2_Engine' failed to build.
      Solution 'NetWeaver2_WPF35' failed to build project 'NetWeaver2_WPF35'.
   <- Task RemObjects.EBuild.BuildSolution failed for NetWeaver2_WPF35, took 0.6310s (0.630s).

Any idea what to look for?

Steve

This is, by definition, a compiler bug…

Could you share the project that is showing this with us (either here or via PM; we will keep it confidential)? I’m afraid without a test case this will be next to impossible to give a recommendation where to look, let alone reproduce or fix.

thanx!

Here is a link to the project, since it is pretty big. image001.pngNWProjects.zip

The location of the project itself is under the NW2_Projects_Prism folder, called Netweaver2_WPF35.

Steve

1 Like

Logged as bugs://E25179.

FWIW, I can reproduce the issue, bit I cant narrow it down to a specific piece of code (or rather, I could, TAdoConnectionStrings, but removing thaws code just made it move); I’ll have to leave this to the compiler team to find the root cause…

Thank you, I appreciate the effort.

Steve

1 Like

It looks like the PRISM define is defined twice, which is just a case we never had before. Fixed for fridays build.

bugs://E25179 was closed as fixed.

Confirmed, after removing the define from the project, it builds on to other (valid) errors, due to missing references, e.g.:

uses
  System.Data, // E26 Unknown namespace "System.Data" in uses list
  System.Drawing, // E26 Unknown namespace "System.Drawing" in uses list
  System.IO,
  System.Text;