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: System.Web (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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.