Bug 31450 - Microsoft.Data.Services.Client.Portable does not work well with Xamarin for Android 5.0 and above
Summary: Microsoft.Data.Services.Client.Portable does not work well with Xamarin for A...
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 5.0
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: Marek Habersack
Depends on:
Reported: 2015-06-28 21:40 UTC by jackjoy
Modified: 2017-09-19 16:52 UTC (History)
4 users (show)

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

Sample project to reproduce the issue (231.37 KB, application/octet-stream)
2015-07-17 05:45 UTC, jackjoy

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 Developer Community or GitHub 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 jackjoy 2015-06-28 21:40:53 UTC
Microsoft.Data.Services.Client.Portable 5.6.x works very well with Xamarin for android 4.4 (Xamarin.VisualStudio_3.0.54.0) which use the data service client proxy generated by visual studio for silverlight project.But it does not work well with Xamarian for android 5.0 and above(Xamarin.VisualStudio_3.9.533 & Xamarin.VisualStudio_3.11.590).The BeginSaveChanges method of DataServiceContext class does not function properly and blocked at some place frequently.May be a deadlock problem.Changes of http stack may be the cause.
Comment 1 Rajneesh Kumar 2015-07-08 07:08:29 UTC
I tried to reproduce this issue but not able to reproduce. I am not sure about the steps, could you please share steps to reproduce this issue or any sample application that demonstrate this issue? That would be very helpful to reproduce this issue at our end.

Comment 2 jackjoy 2015-07-08 21:20:42 UTC
Steps to reproduce this issue:
Dev Tools : Visual Studio 2013

(1) Create a WCF Data Service (Web Application project) as server which use ADO.NET Entity Data model as ORM mapping from database.
(2) Create a silverlight 5.0 project and "Add Service Reference" of data service created in step1,thus the client proxy(Reference.cs) will be generated by visual studio.
(3) Create an Android project using Xamarin for visual studio project,and import the Reference.cs generated in step2.Also need to add Microsoft.Data.Services.Client.Portable 5.6.x reference to this project use NuGet.
(4) In Android project create in step3, add a new entity to any table and call BeginSaveChanges to save changes.We use the following wrapper to get an awaitable task:

      public static Task<DataServiceResponse> SaveChangesAsync(
          this DataServiceContext serviceContext)
            return Task.Factory.FromAsync(
                serviceContext.BeginSaveChanges(null, null),
                (ar) => serviceContext.EndSaveChanges(ar));

When debugging in visual studio,EndSaveChanges not be called frequently,and seemed to be blocked at some place.Thus the awaitable task frequently not finished successfully.
Comment 3 jackjoy 2015-07-17 03:41:31 UTC
How is the test going? If you still cannot reproduce the issue,please let me know and i'll provide you a sample project.
Comment 4 Rajneesh Kumar 2015-07-17 04:14:46 UTC
Hi @ jackjoy, thanks a lot for providing me steps to check this issue, it have tried but this issue is still hard to reproduce. So please provide me a small sample application that demonstrate this issue, so that I can reproduce and CONFIRMED this issue efficiently.

Comment 5 jackjoy 2015-07-17 05:45:33 UTC
Created attachment 12085 [details]
Sample project to reproduce the issue

(1) Restore Microsoft SQL Server 2008 R2 database 'Sample' in database folder.
(2) Modify connection strings in web.config of Test.WebServer project 
(3) Create a web site for Test.WebServer project
(4) Modify WCF Data service's url in MainActivity.cs of Test.Android project

This sample works well with Xamarin.VisualStudio_3.0.54.0.
But not works well with Xamarin.VisualStudio_3.9.533 and Xamarin.VisualStudio_3.11.590.
Comment 6 jackjoy 2015-07-17 05:48:37 UTC
NOTE: Nuget packages not inclued in the attachment to decrease the size of zip.

Comment 7 jackjoy 2015-07-20 21:15:16 UTC
How is the test going now?Any progress?
Comment 8 jackjoy 2015-07-24 21:58:25 UTC
What's going on? This issue is very boring for us and we are forced to use the old Xamarin.VisualStudio_3.0.54.0 for development.We hope this issue was fixed as soon as possible.
Comment 9 jackjoy 2015-08-21 21:59:35 UTC
Any progress?
Comment 10 Anthony 2015-08-26 07:02:31 UTC

Is this bug related?


Comment 11 Jon Douglas [MSFT] 2017-09-19 16:52:48 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.