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 (show other bugs)
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:


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

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.

Create a new report for Bug 27036 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

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.

Related Links: