Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 18977 [details]
"Index was out of range" in `ClientRuntimeChannel.EndProcess()` when getting WCF reply types that use Dictionaries if SDK assemblies are set to be linked
I am filing this bug and marking it as a duplicate just to document some symptoms that are are in fact already resolved in Cycle 9 Alpha by the fixes mentioned in Bug 36710, Comment 8 [1, 2]. The precise error message from this test case did not previously appear in Bugzilla.
## Verification status: resolved in Xamarin.Android 7.1 (Cycle 9) Alpha version
GOOD: Xamarin.Android 18.104.22.168 (cea7c6e)
BAD: Xamarin.Android 22.214.171.124 (501e63c)
BAD: Xamarin.Android 126.96.36.199 (ce955cc)
BAD: Xamarin.Android 188.8.131.52 (1cf254d)
## Manual fix for Xamarin.Android apps that hit this issue
1. Add the following lines to an XML file in the Android app project:
<?xml version="1.0" encoding="utf-8" ?>
<type fullname="System.Runtime.Serialization.KeyValue*" />
2. Set the build action of the XML file to "LinkDescription".
3. Clean, rebuild, and run the Android app.
## Steps to replicate
1. Open HelloWorld.sln from the attached test case in Visual Studio, and follow the steps on  to get the "HelloWorldWcfHost" project running under IIS Express on your machine. For example, you'll need to adjust the IP address for port 9608 in ".vs\config\applicationhost.config". Once you've completed those steps, make sure you can access the service via the IP address of the Windows computer in a web browser.
2. Make sure the "HelloWorldWcfHost" project is running.
3. Open HelloWorld.sln in a second instance of Visual Studio (or in Xamarin Studio on Mac if you prefer) to run the "HelloWorld.Android" project. Make sure you update the IP address in the `EndpointAddress()` constructor in MainActivity.cs to match the Windows computer.
4. Build and run the "HelloWorld.Android" project in the "Debug|Any CPU" configuration on a device or emulator that can access the Windows computer over the network. Note: The project intentionally does _not_ use the Shared Runtime. It currently has armeabi-v7a and x86 enabled under "Supported architectures".
5. Click the "Get Hello World data" button in the running Android app.
## BAD Results
The deserialization of the SOAP response fails. The error message and stack trace are printed to the application output:
> Error: Index was out of range. Must be non-negative and less than the size of the collection.
> Parameter name: index
> at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_delegate_end_invoke (object,intptr)
> at (wrapper delegate-end-invoke) <Module>:end_invoke_object__this___object&_IAsyncResult (object&,System.IAsyncResult)
> at System.ServiceModel.MonoInternal.ClientRuntimeChannel.EndProcess (System.Reflection.MethodBase method, System.String operationName, System.Object parameters, System.IAsyncResult result) [0x00025] in <cda7b5abb2824ad5b313d3676c6883f8>:0
> at System.ServiceModel.ClientBase`1+ChannelBase`1[TChannel,T].EndInvoke (System.String methodName, System.Object args, System.IAsyncResult result) [0x00048] in <cda7b5abb2824ad5b313d3676c6883f8>:0
> at HelloWorldServiceClient+HelloWorldServiceClientChannel.EndGetWarehouseRows (System.IAsyncResult result) [0x00008] in C:\source\LinkerRemovesSerializationKeyValue\HelloWorld.Android\HelloWorldService.cs:363
> at HelloWorldServiceClient.IHelloWorldService.EndGetWarehouseRows (System.IAsyncResult result) [0x00001] in C:\source\LinkerRemovesSerializationKeyValue\HelloWorld.Android\HelloWorldService.cs:210
> at HelloWorldServ
> iceClient.OnEndGetWarehouseRows (System.IAsyncResult result) [0x00001] in C:\source\LinkerRemovesSerializationKeyValue\HelloWorld.Android\HelloWorldService.cs:220
> at System.ServiceModel.ClientBase`1+<InvokeAsync>c__AnonStorey0[TChannel].<>m__0 (System.IAsyncResult ar) [0x00006] in <cda7b5abb2824ad5b313d3676c6883f8>:0
## GOOD Results with the "manual fix" in place
The deserialization succeeds, and the text view on the Android app shows "Success".
## Additional test environment info (brief)
Windows 10 (64-bit), Version 1607 (OS Build 14393.576)
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Tested on VS Emulator for Android (API 19) and Google x86 Android Emulator (API 23).