Bug 13909

Summary: RouteTable.Routes.Clear() doesn't really clear
Product: [Mono] Class Libraries Reporter: TroyDesign.IT <info>
Component: System.WebAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: alkpli, jamie_venning, mono-bugs+mono
Priority: ---    
Version: 2.10.x   
Target Milestone: Untriaged   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description TroyDesign.IT 2013-08-11 09:17:19 UTC
To reproduce it:
RouteTable.Routes.MapPageRoute("test", "test", "~/test.aspx");
RouteTable.Routes.Clear();
RouteTable.Routes.MapPageRoute("test", "test", "~/test.aspx");

It raises exception "An element with the same key already exists in the dictionary. at System.Collections.Generic.Dictionary"

Version information: Mono Runtime Version: 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2); ASP.NET Version: 4.0.30319.1

No problems on Windows PC with .NET Framework 4.0
Comment 1 jamie_venning 2015-12-01 05:02:44 UTC
This is caused by https://github.com/mono/mono/blob/master/mcs/class/System.Web/System.Web.Routing/RouteCollection.cs, ClearItems() on line 108. This method should call d.Clear();
Comment 3 Alexander Köplinger [MSFT] 2016-01-09 03:13:14 UTC
The pull request was merged. Thanks.