This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 13909 - RouteTable.Routes.Clear() doesn't really clear
Summary: RouteTable.Routes.Clear() doesn't really clear
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Sys.Web (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-11 09:17 UTC by TroyDesign.IT
Modified: 2016-01-09 03:13 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.