Bug 5230 - QueryStringConverter.ConvertStringToValue fails on enums
Summary: QueryStringConverter.ConvertStringToValue fails on enums
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: 2.10.x
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2012-05-22 06:13 UTC by DesDesDes
Modified: 2012-08-10 02:51 UTC (History)
6 users (show)

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

Unit test (564 bytes, text/plain)
2012-05-22 06:13 UTC, DesDesDes

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:

Description DesDesDes 2012-05-22 06:13:31 UTC
Created attachment 1938 [details]
Unit test

The QueryStringConverter can convert a enum to a string but fails on converting a string to a enum. Added a unit test to repro the case. Tested on mono 2.10.8 and mono 2.11.1.

System.FormatException: Input string was not in the correct format
  at System.Int32.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00012] in C:\cygwin\sources\mono\mcs\class\corlib\System\Int32.cs:634

  at System.Int32.Parse (System.String s, IFormatProvider provider) [0x00000] in C:\cygwin\sources\mono\mcs\class\corlib\System\Int32.cs:203

  at System.ServiceModel.Dispatcher.QueryStringConverter.ConvertStringToValue (System.String parameter, System.Type parameterType) [0x00101] in C:\cygwin\sources\mono\mcs\class\System.ServiceModel.Web\System.ServiceModel.Dispatcher\QueryStringConverter.cs:85

  at MonoConverterBug.QueryStringConvertBug.TestCase () [0x00020] in C:\Users\bvr\Documents\MonoConverterBug\MonoConverterBug\QueryStringConvertBug.cs:23

  at MonoConverterBug.MainClass.Main (System.String[] args) [0x00007] in C:\Users\bvr\Documents\MonoConverterBug\MonoConverterBug\Main.cs:11
Comment 1 Enrico Sada 2012-08-09 19:46:49 UTC
fix in pull request https://github.com/mono/mono/pull/425