Bug 27036 - Adding the user-agent header to HttpClient object throws a System.FormatException: Invalid format.
Summary: Adding the user-agent header to HttpClient object throws a System.FormatExcep...
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Net.Http ()
Version: 3.12.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2015-02-13 05:28 UTC by Prashant Cholachagudda
Modified: 2015-02-13 08:37 UTC (History)
3 users (show)

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:

Description Prashant Cholachagudda 2015-02-13 05:28:46 UTC
Adding the user-agent header to HttpClient object throws a System.FormatException: Invalid format.


System.FormatException: Invalid format.
  at System.Net.Http.Headers.HttpHeaders.AddInternal (System.String name, IEnumerable`1 values, System.Net.Http.Headers.HeaderInfo headerInfo, Boolean ignoreInvalid) [0x00000] in <filename unknown>:0 
  at System.Net.Http.Headers.HttpHeaders.Add (System.String name, IEnumerable`1 values) [0x00000] in <filename unknown>:0 
  at System.Net.Http.Headers.HttpHeaders.Add (System.String name, System.String value) [0x00000] in <filename unknown>:0 
  at Data.Services.PersonService+<CreateSession>c__async0.MoveNext () [0x000ac] in /Users/prashantvc/Desktop items/Xamarin/124040/Xamarin-HTTPS Issue in Sim/Xamarin/Data/Services/PersonService.cs:52 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Data.Model.VResponse].GetResult () [0x00000] in <filename unknown>:0 
  at Data.ViewModel.LoginViewModel+<>c__async1.MoveNext () [0x00102] in /Users/prashantvc/Desktop items/Xamarin/124040/Xamarin-HTTPS Issue in Sim/Xamarin/Data/ViewModel/LoginViewModel.cs:55 

Test case: https://gist.github.com/prashantvc/d6e8cab1e242b9c22d64
Comment 1 Marek Safar 2015-02-13 08:37:55 UTC
Fixed in master