[Mono-list] Error compiling webservice: An element with the samekey already exists in the dictionary.

Andrus kobruleht2 at hot.ee
Mon Dec 15 15:19:00 EST 2008

> System.ArgumentException: An element with the same key already exists in
> the
> dictionary.  at
> System.Collections.Generic.Dictionary`2[System.Object,System.Object].Add
> (System.Object key, System.Object value) [0x00000]   at
> System.Web.Compilation.BuildManager.AddToCache (System.String virtualPath,

Exception occurs using SVN code also.
It occurs in System.Web.Compilation BuildManager.cs at line

    dependencyCache.Add (virtualPath, files);

I added check before this line

 if (!dependencyCache.ContainsKey (virtualPath))
    dependencyCache.Add (virtualPath, files);

to avoid this error.
No idea why same virtualPath vales are attempted to add two times to cache.


More information about the Mono-list mailing list