An item with the same key has already been added.

Nov 30, 2009 at 7:20 PM

I gave it a try on our website and I am getting the following error.

An item with the same key has already been added.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.Scripting.SyntaxErrorException: An item with the same key has already been added.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SyntaxErrorException: An item with the same key has already been added.]
   Microsoft.Scripting.Hosting.ErrorListenerProxySink.Add(SourceUnit sourceUnit, String message, SourceSpan span, Int32 errorCode, Severity severity) in F:\downloads\dlr\dlr-32871\DLR_Main\Src\Runtime\Microsoft.Scripting\Hosting\ErrorListenerProxy.cs:54
   Dlrsoft.VBScript.Hosting.VBScriptContext.CompileSourceCode(SourceUnit sourceUnit, CompilerOptions options, ErrorSink errorSink) in F:\projects\dotnet35\VBParser80\VBScript\hosting\VBScriptContext.cs:59
   Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, ErrorSink errorSink) in F:\downloads\dlr\dlr-32871\DLR_Main\Src\Runtime\Microsoft.Scripting\SourceUnit.cs:214
   Microsoft.Scripting.SourceUnit.Compile(ErrorSink errorSink) in F:\downloads\dlr\dlr-32871\DLR_Main\Src\Runtime\Microsoft.Scripting\SourceUnit.cs:203
   Microsoft.Scripting.Hosting.ScriptSource.CompileInternal(CompilerOptions compilerOptions, ErrorListener errorListener) in F:\downloads\dlr\dlr-32871\DLR_Main\Src\Runtime\Microsoft.Scripting\Hosting\ScriptSource.cs:115
   Microsoft.Scripting.Hosting.ScriptSource.Compile() in F:\downloads\dlr\dlr-32871\DLR_Main\Src\Runtime\Microsoft.Scripting\Hosting\ScriptSource.cs:79
   Dlrsoft.Asp.AspHost.CompilePage(AspPageDom page) in F:\projects\dotnet35\VBParser80\asp\AspHost.cs:60
   Dlrsoft.Asp.AspHost.ProcessPageFromFile(String pagePath) in F:\projects\dotnet35\VBParser80\asp\AspHost.cs:36
   Dlrsoft.Asp.AspHandler.ProcessRequest(HttpContext context) in F:\projects\dotnet35\VBParser80\asp\AspHandler.cs:64
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Nov 30, 2009 at 9:58 PM

mjarosch, does your page run OK in IIS? The error messages appears to be either a variable or a procedure is redefined. The former is illegal in classic asp but the later is actually legal, for example:

 sub a()
 end sub
'redefine the procedure 
sub a()
 end sub
 call a()

If this is the problem, I will fix it in the next release. Thanks.