What I want to do is s simple screen showing multiple items in a Grid. This can on android easily be archived using a GridView.
In MvvmCross I guess I have to use MvxGridView to archive the same.
Here is my axml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Mvx.MvxGridView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
local:MvxBind="ItemsSource Items"
local:MvxItemTemplate="#layout/itemview" />
</LinearLayout>
The itemview:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<TextView
android:text="Text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/textView1"
local:MvxBind="Text Name" />
</LinearLayout>
My ViewModel:
using System.Collections.ObjectModel;
using Cirrious.MvvmCross.ViewModels;
namespace GridViewBug.Core.ViewModels
{
public class FirstViewModel
: MvxViewModel
{
public FirstViewModel()
{
Items = new ObservableCollection<TestClass>();
Items.Add(new TestClass { Name = "Test1" });
Items.Add(new TestClass { Name = "Test2" });
}
private string _hello = "Hello MvvmCross";
public string Hello
{
get { return _hello; }
set { _hello = value; RaisePropertyChanged(() => Hello); }
}
public ObservableCollection<TestClass> Items { get; set; }
}
public class TestClass
{
public string Name { get; set; }
}
}
And here what happens when I run this example:
05-03 16:18:32.799 I/MvxBind ( 7960): 0.84 Problem seen during binding execution for from Items to ItemsSource - problem TargetInvocationException: Exception has been thrown by the target of an invocation.
05-03 16:18:32.799 I/MvxBind ( 7960): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Bindings.Target.MvxPropertyInfoTargetBinding.SetValue (System.Object value) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding.UpdateTargetFromSource (Boolean isAvailable, System.Object value) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): InnerException was UnsupportedOperationException: Exception of type 'Java.Lang.UnsupportedOperationException' was thrown.
05-03 16:18:32.799 I/MvxBind ( 7960): at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod) [0x00023] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:604
05-03 16:18:32.799 I/MvxBind ( 7960): at Android.Views.ViewGroup.RemoveAllViews () [0x00053] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.ViewGroup.cs:2582
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxViewGroupExtensions.Refill (Android.Views.ViewGroup viewGroup, IAdapter adapter) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxViewGroupExtensions.UpdateDataSetFromChange[MvxGridView] (Cirrious.MvvmCross.Binding.Droid.Views.MvxGridView viewGroup, System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxGridView.AdapterOnDataSetChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at (wrapper delegate-invoke) <Module>:invoke_void__this___object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapterWithChangedEvent.NotifyDataSetChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapterWithChangedEvent.NotifyDataSetChanged () [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.SetItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.set_ItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxGridView.set_ItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
05-03 16:18:32.799 I/MvxBind ( 7960): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/MvxBind ( 7960): --- End of managed exception stack trace ---
05-03 16:18:32.799 I/MvxBind ( 7960): java.lang.UnsupportedOperationException: removeAllViews() is not supported in AdapterView
05-03 16:18:32.799 I/MvxBind ( 7960): at android.widget.AdapterView.removeAllViews(AdapterView.java:521)
05-03 16:18:32.799 I/MvxBind ( 7960): at cirrious.mvvmcross.binding.droid.binders.MvxBindingLayoutInflatorFactory.n_onCreateView(Native Method)
05-03 16:18:32.799 I/MvxBind ( 7960): at cirrious.mvvmcross.binding.droid.binders.MvxBindingLayoutInflatorFactory.onCreateView(MvxBindingLayoutInflatorFactory.java:29)
05-03 16:18:32.799 I/MvxBind ( 7960): at android.view.LayoutInflater.createViewFromTag(Layo
05-03 16:18:32.799 I/mono-stdout( 7960): MvxBind:Error: 0.84 Problem seen during binding execution for from Items to ItemsSource - problem TargetInvocationException: Exception has been thrown by the target of an invocation.
05-03 16:18:32.799 I/mono-stdout( 7960): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/mono-stdout( 7960): at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/mono-stdout( 7960): at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <filename unknown>:0
05-03 16:18:32.799 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Bindings.Target.MvxPropertyInfoTargetBinding.SetValue (System.Object value) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding.UpdateTargetFromSource (Boolean isAvailable, System.Object value) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): InnerException was UnsupportedOperationException: Exception of type 'Java.Lang.UnsupportedOperationException' was thrown.
05-03 16:18:32.809 I/mono-stdout( 7960): at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod) [0x00023] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:604
05-03 16:18:32.809 I/mono-stdout( 7960): at Android.Views.ViewGroup.RemoveAllViews () [0x00053] in /Users/builder/data/lanes/monodroid-lion-bs1/03814ac5/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.ViewGroup.cs:2582
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxViewGroupExtensions.Refill (Android.Views.ViewGroup viewGroup, IAdapter adapter) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxViewGroupExtensions.UpdateDataSetFromChange[MvxGridView] (Cirrious.MvvmCross.Binding.Droid.Views.MvxGridView viewGroup, System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxGridView.AdapterOnDataSetChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at (wrapper delegate-invoke) <Module>:invoke_void__this___object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapterWithChangedEvent.NotifyDataSetChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapterWithChangedEvent.NotifyDataSetChanged () [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.SetItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.set_ItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at Cirrious.MvvmCross.Binding.Droid.Views.MvxGridView.set_ItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
05-03 16:18:32.809 I/mono-stdout( 7960): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
05-03 16:18:32.809 I/mono-stdout( 7960): --- End of managed exception stack trace ---
05-03 16:18:32.809 I/mono-stdout( 7960): java.lang.UnsupportedOperationException: removeAllViews() is not supported in AdapterView
05-03 16:18:32.809 I/mono-stdout( 7960): at android.widget.AdapterView.removeAllViews(AdapterView.java:521)
05-03 16:18:32.809 I/mono-stdout( 7960): at cirrious.mvvmcross.binding.droid.binders.MvxBindingLayoutInflatorFactory.n_onCreateView(Native Method)
05-03 16:18:32.809 I/mono-stdout( 7960): at cirrious.mvvmcross.binding.droid.binders.MvxBindingLayoutInflatorFactory.onCreateView(MvxBindingLayoutInflatorFactory.java:29)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-03 16:18:32.809 I/mono-stdout( 7960): at gridviewbug.droid.views.FirstView.n_onCreate(Native Method)
05-03 16:18:32.809 I/mono-stdout( 7960): at gridviewbug.droid.views.FirstView.onCreate(FirstView.java:28)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.Activity.performCreate(Activity.java:4465)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.os.Handler.dispatchMessage(Handler.java:99)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.os.Looper.loop(Looper.java:137)
05-03 16:18:32.809 I/mono-stdout( 7960): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-03 16:18:32.809 I/mono-stdout( 7960): at java.lang.reflect.Method.invokeNative(Native Method)
05-03 16:18:32.809 I/mono-stdout( 7960): at java.lang.reflect.Method.invoke(Method.java:511)
05-03 16:18:32.809 I/mono-stdout( 7960): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-03 16:18:32.809 I/mono-stdout( 7960): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-03 16:18:32.809 I/mono-stdout( 7960): at dalvik.system.NativeStart.main(Native Method)
What I'm doing wrong?
I'm using the latest stuff I can get from Nuget. Running on Mono Android 4.6.4 in VS2012
Here is the repo with the complete code:
https://github.com/sschoeb/MvvmCrossGridViewProblem
From the tracem it looks like a straight-forward bug, probably a regression that occured somewhere while fixing another issue.
Your best bet would be to open an issue for this on GitHub - https://github.com/slodge/MvvmCross/issues/new? Or you could fork the source and fix it in your branch.
In the meantime, maybe try using the MvxListView? Or create a new bindable ViewGroup?
Related
I have a physical device connected. When the phone is locked and I deploy the application after unlocking, the application works and everything is fine. But if the screen is unlocked and I deploy I get the following error. In this case, everything is ok on the emulator. Help me understand this nonsense.
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'
[HotReload] (2021-03-17 23:08:35.2): INFO: Инициализация горячей перезагрузки XAML…
[HotReload] (2021-03-17 23:08:35.2): WARN: (DriverHelper v 2.0.Android) Unknown Breakpoint Hit: Android.Runtime.JNIEnv.RegisterJniNatives( typeName_ptr, int typeName_len, jniClass, methods_ptr, int methods_len)
"<unnamed thread>" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Diagnostics.Debugger.Mono_UnhandledException_internal (System.Exception) <0x00007>
at System.Diagnostics.Debugger.Mono_UnhandledException (System.Exception) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:125
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.46 (intptr,intptr) [0x00020] in <44e54a86dea24313a2bdb807df77c27a>:0
at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.46 (intptr,intptr) [0x00033] in <44e54a86dea24313a2bdb807df77c27a>:0
"ProtocolHandler.SendThread" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler/WaitableActionsList.WaitForData () [0x00019] in <c37c1589af144356b99fb170c5e22242>:0
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ActionThread (object) [0x00045] in <c37c1589af
144356b99fb170c5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:78
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/
03-17 23:08:49.317 E/mono (27416): Full thread dump:referencesource/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:93
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0006b] in <c72658f647bc485bbfb8c9fcaa790862>:0
"<threadpool thread>"
"Debugger agent"
"Thread Pool Worker"
"Thread Pool Worker"
"Thread Pool Worker"
"Timer-Scheduler"
"Finalizer"
"ProtocolHandler.ProcessThread" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android
/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler/WaitableActionsList.WaitForData () [0x00019] in <c37c1589af144356b99fb170c5e22242>:0
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ActionThread (object) [0x00045] in <c37c1589af144356b99fb170c5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:78
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/re
ferencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:93
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0006b] in <c72658f647bc485bbfb8c9fcaa790862>:0
"ProtocolHandler.ReadThread" at <unknow
n> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Xamarin.HotReload.HotReloadAgent.Microsoft.VisualStudio.DesignTools.TapContract.Networking.IDataBridge.ReadMessage () [0x0002f] in D:\a\1\s\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:341
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ReadThread () [0x00038] in <c37c1589af144356b99fb170c
5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00014] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:74
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource
/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:111
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x00067] in <c72658f647bc485bbfb8c9fcaa790862>:0
I have a Blazor WASM application that has an OData back-end. I'm trying to configure the NavigationProperty of one of my models so that I can use the $expand= query parameter to return more data but I keep getting the following error when trying to make a PATCH request (GET works just fine):
Microsoft.OData.ODataException: The property 'JobId' does not exist on type 'Coin.ODataOrderHeader'. Make sure to only use property names that are defined by the type or mark the type as open type.
But it does exist! Not just in the model:
public partial class ODataOrderHeader
{
[Key]
public int OrderId { get; set; }
[Column("JobID")]
[ForeignKey("Job")]
public int JobId { get; set; }
...
[System.Text.Json.Serialization.JsonPropertyName("Job")]
public virtual Jobs Job { get; set; }
}
But in the $metadata document as well:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="Coin" xmlns="http://docs.oasis-open.org/odata/ns/edm">
...
<EntityType Name="ODataOrderHeader">
<Key>
<PropertyRef Name="OrderId" />
</Key>
<Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
<Property Name="JobId" Type="Edm.Int32" />
...
<NavigationProperty Name="Job" Type="Coin.Jobs">
<ReferentialConstraint Property="JobId" ReferencedProperty="JobId" />
</NavigationProperty>
</EntityType>
...
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Here is the code that creates the model:
private IEdmModel GetEdmModel()
{
var builder = new ODataConventionModelBuilder();
builder.Namespace = "Coin";
builder.ContainerName = "CoinContainer";
...
var orders = builder.EntitySet<ODataOrderHeader>("Orders");
return builder.GetEdmModel();
}
I should probably point out, ODataOrderHeader is more of a DTO type whereas Jobs is an EF scaffolded type.
Here is the Simple.OData.Client code that calls the API:
private async void UpdateItem()
{
ODataClient client = new ODataClient(new ODataClientSettings(HttpClient, new Uri("odata", UriKind.Relative)));
await client.For<ODataOrderHeader>("Orders")
.Key(currentOrder.OrderId)
.Set(currentOrder)
.UpdateEntryAsync();
}
And here's the controller action that the above code is calling:
[ODataRoute("/orders({key})")]
public async Task<IActionResult> Patch([FromODataUri] int key, Delta<ODataOrderHeader> order)
{
if (!ModelState.IsValid)
return BadRequest();
...
}
And lastly, the error message in its entirety:
Unhandled Exception:
Microsoft.OData.ODataException: The property 'JobId' does not exist on type 'Coin.ODataOrderHeader'. Make sure to only use property names that are defined by the type or mark the type as open type.
at Microsoft.OData.WriterValidationUtils.ValidatePropertyDefined (Microsoft.OData.PropertySerializationInfo propertyInfo, System.Boolean throwOnUndeclaredProperty) <0x61a9028 + 0x00098> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightPropertySerializer.WritePropertyInfo (Microsoft.OData.ODataPropertyInfo propertyInfo, Microsoft.OData.Edm.IEdmStructuredType owningType, System.Boolean isTopLevel, Microsoft.OData.IDuplicatePropertyNameChecker duplicatePropertyNameChecker, Microsoft.OData.Evaluation.ODataResourceMetadataBuilder metadataBuilder) <0x6120d78 + 0x000f8> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightPropertySerializer.WriteProperty (Microsoft.OData.ODataProperty property, Microsoft.OData.Edm.IEdmStructuredType owningType, System.Boolean isTopLevel, Microsoft.OData.IDuplicatePropertyNameChecker duplicatePropertyNameChecker, Microsoft.OData.Evaluation.ODataResourceMetadataBuilder metadataBuilder) <0x61203e8 + 0x00018> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightPropertySerializer.WriteProperties (Microsoft.OData.Edm.IEdmStructuredType owningType, System.Collections.Generic.IEnumerable`1[T] properties, System.Boolean isComplexValue, Microsoft.OData.IDuplicatePropertyNameChecker duplicatePropertyNameChecker, Microsoft.OData.Evaluation.ODataResourceMetadataBuilder metadataBuilder) <0x6011c28 + 0x00048> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightWriter.StartResource (Microsoft.OData.ODataResource resource) <0x5ef5478 + 0x003d6> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore+<>c__DisplayClass121_0.<WriteStartResourceImplementation>b__0 () <0x5ed80f0 + 0x00082> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore.InterceptException (System.Action action) <0x5ed3f20 + 0x00042> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore.WriteStartResourceImplementation (Microsoft.OData.ODataResource resource) <0x5ed3a78 + 0x00076> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore+<>c__DisplayClass49_0.<WriteStartAsync>b__0 () <0x5ed3628 + 0x0000c> in <filename unknown>:0
at Microsoft.OData.TaskUtils.GetTaskForSynchronousOperation (System.Action synchronousOperation) <0x5ed34e0 + 0x0000a> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at Simple.OData.Client.V4.Adapter.RequestWriter.WriteEntryPropertiesAsync (Microsoft.OData.ODataWriter entryWriter, Microsoft.OData.ODataResource entry, System.Collections.Generic.IDictionary`2[TKey,TValue] links) <0x5ed2260 + 0x000f2> in <filename unknown>:0
at Simple.OData.Client.V4.Adapter.RequestWriter.WriteEntryContentAsync (System.String method, System.String collection, System.String commandText, System.Collections.Generic.IDictionary`2[TKey,TValue] entryData, System.Boolean resultRequired) <0x5477750 + 0x0049c> in <filename unknown>:0
at Simple.OData.Client.RequestWriterBase.CreateUpdateRequestAsync (System.String collection, System.String entryIdent, System.Collections.Generic.IDictionary`2[TKey,TValue] entryKey, System.Collections.Generic.IDictionary`2[TKey,TValue] entryData, System.Boolean resultRequired) <0x5814b98 + 0x0020c> in <filename unknown>:0
at Simple.OData.Client.RequestBuilder.UpdateRequestAsync (System.Boolean resultRequired, System.Threading.CancellationToken cancellationToken) <0x577cd28 + 0x00386> in <filename unknown>:0
at Simple.OData.Client.ODataClient.UpdateEntryAsync (Simple.OData.Client.FluentCommand command, System.Boolean resultRequired, System.Threading.CancellationToken cancellationToken) <0x577bcc8 + 0x00162> in <filename unknown>:0
at Simple.OData.Client.BoundClient`1[T].UpdateEntryAsync (System.Boolean resultRequired, System.Threading.CancellationToken cancellationToken) <0x576d9a0 + 0x00230> in <filename unknown>:0
at Coin.Client.Pages.OrderEdit.UpdateItem () [0x000ac] in C:\Users\trichardson\source\Workspaces\Corsi\COIN2\Client\Pages\OrderEdit.razor:393
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_1 (System.Object state) <0x6547930 + 0x0000c> in <filename unknown>:0
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) <0x65478e0 + 0x00022> in <filename unknown>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x3112fc8 + 0x00100> in <filename unknown>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x310b7d8 + 0x00010> in <filename unknown>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x5743290 + 0x00038> in <filename unknown>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x39a89b8 + 0x00102> in <filename unknown>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x39a4578 + 0x00000> in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.OData.ODataException: The property 'JobId' does not exist on type 'Coin.ODataOrderHeader'. Make sure to only use property names that are defined by the type or mark the type as open type.
at Microsoft.OData.WriterValidationUtils.ValidatePropertyDefined (Microsoft.OData.PropertySerializationInfo propertyInfo, System.Boolean throwOnUndeclaredProperty) <0x61a9028 + 0x00098> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightPropertySerializer.WritePropertyInfo (Microsoft.OData.ODataPropertyInfo propertyInfo, Microsoft.OData.Edm.IEdmStructuredType owningType, System.Boolean isTopLevel, Microsoft.OData.IDuplicatePropertyNameChecker duplicatePropertyNameChecker, Microsoft.OData.Evaluation.ODataResourceMetadataBuilder metadataBuilder) <0x6120d78 + 0x000f8> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightPropertySerializer.WriteProperty (Microsoft.OData.ODataProperty property, Microsoft.OData.Edm.IEdmStructuredType owningType, System.Boolean isTopLevel, Microsoft.OData.IDuplicatePropertyNameChecker duplicatePropertyNameChecker, Microsoft.OData.Evaluation.ODataResourceMetadataBuilder metadataBuilder) <0x61203e8 + 0x00018> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightPropertySerializer.WriteProperties (Microsoft.OData.Edm.IEdmStructuredType owningType, System.Collections.Generic.IEnumerable`1[T] properties, System.Boolean isComplexValue, Microsoft.OData.IDuplicatePropertyNameChecker duplicatePropertyNameChecker, Microsoft.OData.Evaluation.ODataResourceMetadataBuilder metadataBuilder) <0x6011c28 + 0x00048> in <filename unknown>:0
at Microsoft.OData.JsonLight.ODataJsonLightWriter.StartResource (Microsoft.OData.ODataResource resource) <0x5ef5478 + 0x003d6> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore+<>c__DisplayClass121_0.<WriteStartResourceImplementation>b__0 () <0x5ed80f0 + 0x00082> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore.InterceptException (System.Action action) <0x5ed3f20 + 0x00042> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore.WriteStartResourceImplementation (Microsoft.OData.ODataResource resource) <0x5ed3a78 + 0x00076> in <filename unknown>:0
at Microsoft.OData.ODataWriterCore+<>c__DisplayClass49_0.<WriteStartAsync>b__0 () <0x5ed3628 + 0x0000c> in <filename unknown>:0
at Microsoft.OData.TaskUtils.GetTaskForSynchronousOperation (System.Action synchronousOperation) <0x5ed34e0 + 0x0000a> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at Simple.OData.Client.V4.Adapter.RequestWriter.WriteEntryPropertiesAsync (Microsoft.OData.ODataWriter entryWriter, Microsoft.OData.ODataResource entry, System.Collections.Generic.IDictionary`2[TKey,TValue] links) <0x5ed2260 + 0x000f2> in <filename unknown>:0
at Simple.OData.Client.V4.Adapter.RequestWriter.WriteEntryContentAsync (System.String method, System.String collection, System.String commandText, System.Collections.Generic.IDictionary`2[TKey,TValue] entryData, System.Boolean resultRequired) <0x5477750 + 0x0049c> in <filename unknown>:0
at Simple.OData.Client.RequestWriterBase.CreateUpdateRequestAsync (System.String collection, System.String entryIdent, System.Collections.Generic.IDictionary`2[TKey,TValue] entryKey, System.Collections.Generic.IDictionary`2[TKey,TValue] entryData, System.Boolean resultRequired) <0x5814b98 + 0x0020c> in <filename unknown>:0
at Simple.OData.Client.RequestBuilder.UpdateRequestAsync (System.Boolean resultRequired, System.Threading.CancellationToken cancellationToken) <0x577cd28 + 0x00386> in <filename unknown>:0
at Simple.OData.Client.ODataClient.UpdateEntryAsync (Simple.OData.Client.FluentCommand command, System.Boolean resultRequired, System.Threading.CancellationToken cancellationToken) <0x577bcc8 + 0x00162> in <filename unknown>:0
at Simple.OData.Client.BoundClient`1[T].UpdateEntryAsync (System.Boolean resultRequired, System.Threading.CancellationToken cancellationToken) <0x576d9a0 + 0x00230> in <filename unknown>:0
at Coin.Client.Pages.OrderEdit.UpdateItem () [0x000ac] in C:\Users\trichardson\source\Workspaces\Corsi\COIN2\Client\Pages\OrderEdit.razor:393
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_1 (System.Object state) <0x6547930 + 0x0000c> in <filename unknown>:0
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) <0x65478e0 + 0x00022> in <filename unknown>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x3112fc8 + 0x00100> in <filename unknown>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) <0x310b7d8 + 0x00010> in <filename unknown>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x5743290 + 0x00038> in <filename unknown>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x39a89b8 + 0x00102> in <filename unknown>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x39a4578 + 0x00000> in <filename unknown>:0
Uncaught ExitStatusThe program '' has exited with code -1 (0xffffffff).
Is there a configuration error I'm missing or is there something wrong with the controller action?
For anyone that stumbles across this in the future, I was able to uncover a little more information.
Firstly, by adding some data annotations [IgnoreDataMember] on my Jobs class and by adding {IgnoreUnmappedProperties = true} when instantiating the ODataClient, I was able to get a different error. Something along the lines of: The key 'JobId' does not exist in the dictionary.
For context, I'm trying to do what OData refers to as a "deep update". I want to update a child entity while updating the parent entity. However, Simple.OData.Client does not support deep updates or deep linking or deep creation. Here's a 5 year old question from Simple.OData.Client's GitHub page that talks about this and unfortunately, it would appear that development of this package has ceased ("Future of Simple.OData.Client" and "Project Dead?"). Since it doesn't support "deep updates", it doesn't know how to generate the request URL which is why my PATCH request was failing.
i am using realm.xamarin 0.75 with xamarin forms and while executing query, i get a weird error. the query is
DateTimeOffset fromOffset = new DateTimeOffset(fromDate);
DateTimeOffset toOffset = new DateTimeOffset(toDate);
var config = DependencyService.Get<IDatabase>().GetConfiguration();
using (var realm = Realm.GetInstance(config))
{
return realm.All<Measurements>()Where(o => o.CreatedDateTime >= fromOffset && o.CreatedDateTime <= toOffset).OrderByDescending(o => o.CreatedDateTime).ToList();
}
And the error is:
UNHANDLED EXCEPTION:
06-06 17:46:15.337 I/MonoDroid(26505): Realms.RealmException: Data type mismatch
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.NativeCommon.ExceptionThrower (NativeException exception) [0x00007] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at (wrapper native-to-managed) Realms.NativeCommon:ExceptionThrower (Realms.NativeException)
06-06 17:46:15.337 I/MonoDroid(26505): at (wrapper managed-to-native) Realms.NativeQuery:timestamp_milliseconds_greater_equal (Realms.QueryHandle,intptr,long)
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResultsVisitor.AddQueryGreaterThanOrEqual (Realms.QueryHandle queryHandle, System.String columnName, System.Object value) [0x000b6] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResultsVisitor.VisitBinary (System.Linq.Expressions.BinaryExpression b) [0x0016c] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.ExpressionVisitor.Visit (System.Linq.Expressions.Expression exp) [0x000d2] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResultsVisitor.VisitCombination (System.Linq.Expressions.BinaryExpression b, System.Action`1 combineWith) [0x00012] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResultsVisitor.VisitBinary (System.Linq.Expressions.BinaryExpression b) [0x0000c] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.ExpressionVisitor.Visit (System.Linq.Expressions.Expression exp) [0x000d2] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResultsVisitor.VisitMethodCall (System.Linq.Expressions.MethodCallExpression m) [0x0006a] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.ExpressionVisitor.Visit (System.Linq.Expressions.Expression exp) [0x000ec] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResultsVisitor.VisitMethodCall (System.Linq.Expressions.MethodCallExpression m) [0x000e6] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.ExpressionVisitor.Visit (System.Linq.Expressions.Expression exp) [0x000ec] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResults`1[T].CreateResultsHandle () [0x00037] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResults`1[T].get_ResultsHandle () [0x0000d] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at Realms.RealmResults`1[T].GetEnumerator () [0x00000] in <filename unknown>:0
06-06 17:46:15.337 I/MonoDroid(26505): at System.Collections.Generic.List`1[T]..ctor (IEnumerable`1 collection) [0x00073] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/collections/generic/list.cs:104
06-06 17:46:15.337 I/MonoDroid(26505): at System.Linq.Enumerable.ToList[TSource] (IEnumerable`1 source) [0x00011] in /Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:835
i suscpect DateTimeOffset could be causing the issue.
i checked the source code at https://github.com/realm/realm-dotnet
but couldn't find anything.
I found the issue. It happens when the class for RealmObject(in my case Measurements) is not inheriting directly from RealmObject.
My class Measurements was inheriting from a class BaseModel (i created this class for internal purpose) and this BaseModel class was inheriting from RealmObject.
When i removed this and made Measurements inherit directly from RealmObject, i doesn't throws exception.
From Dimitris Tavlikos 's comment,
Realm Xamarin does not allow models to be further subclassed in any way. The CreateObject generic method only works if you use it for a class which descends directly from RealmObject.
https://realm.io/docs/xamarin/latest/#model-inheritance
I'm trying to add Realm to my app (Xamarin Android). Starting with emulator first (Xaamrin android player - Nexus 5 with Android Lollipop).
Github Issue here
My code:
protected override async void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.MyActivitylayout);
....
try
{
var path = AndroidIoHelper.CreateFileInAppFolder(AndroidIoHelper.GetAppDataFolder(), "tlm_db", "realm");
var realm = Realm.GetInstance(path);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
.......
}
Exception I'm getting:
Realms.RealmFileAccessErrorException: Operation not permitted at
Realms.NativeCommon.ExceptionThrower (IntPtr exceptionCode, IntPtr
utf8String, IntPtr stringLen) [0x0003b] in :0 at
(wrapper native-to-managed) Realms.NativeCommon:ExceptionThrower
(intptr,intptr,intptr) at (wrapper managed-to-native)
Realms.NativeSharedRealm:open
(Realms.SchemaHandle,string,intptr,intptr,intptr,byte[],ulong) 05-15
12:57:18.384 I/mono-stdout( 5250):
Realms.RealmFileAccessErrorException: Operation not permitted 05-15
12:57:18.384 I/mono-stdout( 5250): at
Realms.NativeCommon.ExceptionThrower (IntPtr exceptionCode, IntPtr
utf8String, IntPtr stringLen) [0x0003b] in :0 05-15
12:57:18.384 I/mono-stdout( 5250): at (wrapper native-to-managed)
Realms.NativeCommon:ExceptionThrower (intptr,intptr,intptr) 05-15
12:57:18.385 I/mono-stdout( 5250): at (wrapper managed-to-native)
Realms.NativeSharedRealm:open
(Realms.SchemaHandle,string,intptr,intptr,intptr,byte[],ulong) 05-15
12:57:18.385 I/mono-stdout( 5250): at Realms.Realm.GetInstance
(Realms.RealmConfiguration config) [0x0010c] in :0
05-15 12:57:18.385 I/mono-stdout( 5250): at Realms.Realm.GetInstance
(System.String databasePath) [0x00019] in :0 05-15
12:57:18.385 I/mono-stdout( 5250): at
MyApp.Activities.SplashScreenActivity+d__4.MoveNext ()
[0x00116] in
C:\Users***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
at Realms.Realm.GetInstance (Realms.RealmConfiguration config)
[0x0010c] in :0 at Realms.Realm.GetInstance
(System.String databasePath) [0x00019] in :0 at
MyApp.Activities.SplashScreenActivity+d__4.MoveNext ()
[0x00116] in
C:\Users***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
If I don't specify path I'm getting (var realm = Realm.GetInstance();):
System.ArgumentNullException: Value cannot be null. Parameter name:
type at System.Activator.CreateInstance (System.Type type, Boolean
nonPublic) [0x00006] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:205
05-15 13:05:05.257 I/mono-stdout( 5474): System.ArgumentNullException:
Value cannot be null. 05-15 13:05:05.257 I/mono-stdout( 5474):
Parameter name: type 05-15 13:05:05.257 I/mono-stdout( 5474): at
System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
[0x00006] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:205
05-15 13:05:05.257 I/mono-stdout( 5474): at
System.Activator.CreateInstance (System.Type type) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:147
at System.Activator.CreateInstance (System.Type type) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:147
at Realms.Realm.CreateRealmObjectMetadata (System.Type
realmObjectType) [0x0001e] in :0 at
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector, IEqualityComparer1 comparer) [0x0004d] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:855
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:847
at Realms.Realm..ctor (Realms.SharedRealmHandle sharedRealmHandle,
Realms.RealmConfiguration config) [0x00037] in <filename unknown>:0
at Realms .Realm.GetInstance (Realms.RealmConfiguration config)
[0x00171] in <filename unknown>:0 at
MyApp.Activities.SplashScreenActivity+<OnCreate>d__4.MoveNext ()
[0x00116] in
C:\Users\***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
05-15 13:05:05.257 I/mono-stdout( 5474): at
Realms.Realm.CreateRealmObjectMetadata (System.Type realmObjectType)
[0x0001e] in <filename unknown>:0 05-15 13:05:05.257 I/mono-stdout(
5474): at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector, IEqualityComparer1 comparer) [0x0004d] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:855
05-15 13:05:05.257 I/mono-stdout( 5474): at
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:847
05-15 13:05:05.257 I/mono-stdout( 5474): at Realms.Realm..ctor
(Realms.SharedRealmHandle sharedRealmHandle, Realms.RealmConfiguration
config) [0x00037] in :0 05-15 13:05:05.257
I/mono-stdout( 5474): at Realms.Realm.GetInstance
(Realms.RealmConfiguration config) [0x00171] in :0
05-15 13:05:05.257 I/mono-stdout( 5474): at
MyApp.Activities.SplashScreenActivity+d__4.MoveNext ()
[0x00116] in
C:\Users***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
The app has Write external storage permission.
Realm and Fody nuget packages installed properly, Fody weavers are present as expected..
It also crashes with same exception using HTC One X with Android 4.2
The above attempt had other issues. There is a real bug currently in Realm with storage on external storage - see the issue https://github.com/realm/realm-dotnet/issues/554 which is proving awkward to debug.
With DotCMIS I can successfully start a session to an Alfresco 4.0.1 CMIS server.
But when I call session.GetRootFolder(), I get the exception below:
Unhandled Exception: DotCMIS.Exceptions.CmisConnectionException: Parsing exception! ---> System.InvalidOperationException: There is an error in XML document. ---> System.InvalidOperationException: Read by order only possible for encoded/bare format
at System.Xml.Serialization.ClassMap.GetElement (Int32 index) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.DeserializeObject (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.ParseElement (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.ParseEntry (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.Parse () [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.Parse[AtomEntry] (System.IO.Stream stream) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.Parse[AtomEntry] (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.GetObjectInternal (System.String repositoryId, IdentifierType idOrPath, System.String objectIdOrPath, Nullable`1 returnVersion, System.String filter, Nullable`1 includeAllowableActions, Nullable`1 includeRelationships, System.String renditionFilter, Nullable`1 includePolicyIds, Nullable`1 includeAcl, IExtensionsData extension) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.ObjectService.GetObject (System.String repositoryId, System.String objectId, System.String filter, Nullable`1 includeAllowableActions, Nullable`1 includeRelationships, System.String renditionFilter, Nullable`1 includePolicyIds, Nullable`1 includeAcl, IExtensionsData extension) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetObject (System.String objectId, IOperationContext context) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetObject (IObjectId objectId, IOperationContext context) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetRootFolder (IOperationContext context) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetRootFolder () [0x00000] in <filename unknown>:0
at tests.sln.MainClass.Main (System.String[] args) [0x00074] in /home/nico/src/CmisSync/tests/tests.sln/Main.cs:27
[ERROR] FATAL UNHANDLED EXCEPTION: DotCMIS.Exceptions.CmisConnectionException: Parsing exception! ---> System.InvalidOperationException: There is an error in XML document. ---> System.InvalidOperationException: Read by order only possible for encoded/bare format
at System.Xml.Serialization.ClassMap.GetElement (Int32 index) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObjectElement (System.Xml.Serialization.XmlTypeMapElementInfo elem) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.DeserializeObject (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.ParseElement (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.ParseEntry (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AtomPubParser.Parse () [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.Parse[AtomEntry] (System.IO.Stream stream) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.Parse[AtomEntry] (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.AbstractAtomPubService.GetObjectInternal (System.String repositoryId, IdentifierType idOrPath, System.String objectIdOrPath, Nullable`1 returnVersion, System.String filter, Nullable`1 includeAllowableActions, Nullable`1 includeRelationships, System.String renditionFilter, Nullable`1 includePolicyIds, Nullable`1 includeAcl, IExtensionsData extension) [0x00000] in <filename unknown>:0
at DotCMIS.Binding.AtomPub.ObjectService.GetObject (System.String repositoryId, System.String objectId, System.String filter, Nullable`1 includeAllowableActions, Nullable`1 includeRelationships, System.String renditionFilter, Nullable`1 includePolicyIds, Nullable`1 includeAcl, IExtensionsData extension) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetObject (System.String objectId, IOperationContext context) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetObject (IObjectId objectId, IOperationContext context) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetRootFolder (IOperationContext context) [0x00000] in <filename unknown>:0
at DotCMIS.Client.Impl.Session.GetRootFolder () [0x00000] in <filename unknown>:0
An important part seems to be: Read by order only possible for encoded/bare format
My code is pretty much straight from the tutorial:
using System;
using System.Collections.Generic;
using DotCMIS;
using DotCMIS.Client.Impl;
using DotCMIS.Client;
using DotCMIS.Data.Impl;
using DotCMIS.Data.Extensions;
namespace tests.sln
{
class MainClass
{
public static void Main (string[] args)
{
// Connect to repository
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters[SessionParameter.BindingType] = BindingType.AtomPub;
parameters[SessionParameter.AtomPubUrl] = "http://localhost:8080/alfresco/cmisatom";
parameters[SessionParameter.User] = "admin";
parameters[SessionParameter.Password] = "admin";
SessionFactory factory = SessionFactory.NewInstance();
ISession session = factory.GetRepositories(parameters)[0].CreateSession();
Console.WriteLine("Created CMIS session: " + session.ToString());
// Get the root folder
IFolder rootFolder = session.GetRootFolder(); // Error happens here
}
}
}
What did I miss?
In debug mode I can see DotCMIS.Client.Impl.Session.GetObject (objectId="workspace://SpacesStore/77acb21f-811c-49a3-be4d-5cc7f177f461" in the stack, not sure what it means but 77acb21f-811c-49a3-be4d-5cc7f177f461 is indeed the node reference of Alfresco's company_home.
If I change the URL to http://localhost:8080/alfresco/service/cmisatom in the code above, then a Not Found error appears earlier, at the GetRepositories line. So I am pretty sure my URL is correct.
I downloaded the DotCMIS source code and am debugging it in Monodevelop now.
With Wireshark I have identified the packet on which the exception happens:
<?xml version='1.0' encoding='UTF-8'?><atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"><atom:author><atom:name>System</atom:name></atom:author><atom:id>http://chemistry.apache.org/d29ya3NwYWNlOi8vU3BhY2VzU3RvcmUvNzdhY2IyMWYtODExYy00OWEzLWJlNGQtNWNjN2YxNzdmNDYx</atom:id><atom:published>2012-06-08T04:46:12Z</atom:published><atom:title>Company Home</atom:title><app:edited>2012-06-08T04:46:22Z</app:edited><atom:updated>2012-06-08T04:46:22Z</atom:updated><cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"><cmis:properties><cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Object Types Ids" localName="allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds" /><cmis:propertyId queryName="cmis:objectTypeId" displayName="Object Type Id" localName="objectTypeId" propertyDefinitionId="cmis:objectTypeId"><cmis:value>cmis:folder</cmis:value></cmis:propertyId><cmis:propertyString queryName="cmis:path" displayName="Path" localName="path" propertyDefinitionId="cmis:path"><cmis:value>/</cmis:value></cmis:propertyString><cmis:propertyString queryName="cmis:name" displayName="Name" localName="name" propertyDefinitionId="cmis:name"><cmis:value>Company Home</cmis:value></cmis:propertyString><cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="creationDate" propertyDefinitionId="cmis:creationDate"><cmis:value>2012-06-08T13:46:12.655+09:00</cmis:value></cmis:propertyDateTime><cmis:propertyString queryName="cmis:changeToken" displayName="Change token" localName="changeToken" propertyDefinitionId="cmis:changeToken" /><cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Last Modified By" localName="lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"><cmis:value>System</cmis:value></cmis:propertyString><cmis:propertyString queryName="cmis:createdBy" displayName="Created by" localName="createdBy" propertyDefinitionId="cmis:createdBy"><cmis:value>System</cmis:value></cmis:propertyString><cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="objectId" propertyDefinitionId="cmis:objectId"><cmis:value>workspace://SpacesStore/77acb21f-811c-49a3-be4d-5cc7f177f461</cmis:value></cmis:propertyId><cmis:propertyId queryName="cmis:baseTypeId" displayName="Base Type Id" localName="baseTypeId" propertyDefinitionId="cmis:baseTypeId"><cmis:value>cmis:folder</cmis:value></cmis:propertyId><cmis:propertyId queryName="alfcmis:nodeRef" displayName="Alfresco Node Ref" localName="nodeRef" propertyDefinitionId="alfcmis:nodeRef"><cmis:value>workspace://SpacesStore/77acb21f-811c-49a3-be4d-5cc7f177f461</cmis:value></cmis:propertyId><cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Last Modified Date" localName="lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"><cmis:value>2012-06-08T13:46:22.049+09:00</cmis:value></cmis:propertyDateTime><cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="parentId" propertyDefinitionId="cmis:parentId" /><aspects:aspects xmlns="http://www.alfresco.org" xmlns:aspects="http://www.alfresco.org"><appliedAspects>P:app:uifacets</appliedAspects><properties><cmis:propertyString xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" propertyDefinitionId="app:icon"><value>space-icon-default</value></cmis:propertyString><cmis:propertyString xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" propertyDefinitionId="cm:description"><value>The company root space</value></cmis:propertyString><cmis:propertyString xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" propertyDefinitionId="cmis:policyText" /><cmis:propertyString xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" propertyDefinitionId="cm:title"><value>Company Home</value></cmis:propertyString></properties><appliedAspects>P:cm:titled</appliedAspects><appliedAspects>P:sys:localized</appliedAspects></aspects:aspects></cmis:properties><cmis:allowableActions><cmis:canDeleteObject>false</cmis:canDeleteObject><cmis:canUpdateProperties>true</cmis:canUpdateProperties><cmis:canGetFolderTree>true</cmis:canGetFolderTree><cmis:canGetProperties>true</cmis:canGetProperties><cmis:canGetObjectRelationships>true</cmis:canGetObjectRelationships><cmis:canGetObjectParents>false</cmis:canGetObjectParents><cmis:canGetFolderParent>false</cmis:canGetFolderParent><cmis:canGetDescendants>true</cmis:canGetDescendants><cmis:canMoveObject>false</cmis:canMoveObject><cmis:canDeleteContentStream>false</cmis:canDeleteContentStream><cmis:canCheckOut>false</cmis:canCheckOut><cmis:canCancelCheckOut>false</cmis:canCancelCheckOut><cmis:canCheckIn>false</cmis:canCheckIn><cmis:canSetContentStream>false</cmis:canSetContentStream><cmis:canGetAllVersions>false</cmis:canGetAllVersions><cmis:canAddObjectToFolder>false</cmis:canAddObjectToFolder><cmis:canRemoveObjectFromFolder>false</cmis:canRemoveObjectFromFolder><cmis:canGetContentStream>false</cmis:canGetContentStream><cmis:canApplyPolicy>false</cmis:canApplyPolicy><cmis:canGetAppliedPolicies>true</cmis:canGetAppliedPolicies><cmis:canRemovePolicy>false</cmis:canRemovePolicy><cmis:canGetChildren>true</cmis:canGetChildren><cmis:canCreateDocument>true</cmis:canCreateDocument><cmis:canCreateFolder>true</cmis:canCreateFolder><cmis:canCreateRelationship>true</cmis:canCreateRelationship><cmis:canDeleteTree>false</cmis:canDeleteTree><cmis:canGetRenditions>false</cmis:canGetRenditions><cmis:canGetACL>true</cmis:canGetACL><cmis:canApplyACL>true</cmis:canApplyACL></cmis:allowableActions></cmisra:object><atom:link rel="service" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e?repositoryId=200a3d48-6a94-4cb7-b1bd-186eb6be0c4e" type="application/atomsvc+xml" /><atom:link rel="self" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/entry?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/atom+xml;type=entry" cmisra:id="workspace://SpacesStore/77acb21f-811c-49a3-be4d-5cc7f177f461" /><atom:link rel="enclosure" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/entry?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/atom+xml;type=entry" /><atom:link rel="edit" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/entry?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/atom+xml;type=entry" /><atom:link rel="describedby" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/type?id=cmis%3Afolder" type="application/atom+xml;type=entry" /><atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/allowableactions?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/cmisallowableactions+xml" /><atom:link rel="down" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/children?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/atom+xml;type=feed" /><atom:link rel="down" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/descendants?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/cmistree+xml" /><atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/foldertree?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/cmistree+xml" /><atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/acl?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/cmisacl+xml" /><atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/policies" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/policies?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/atom+xml;type=feed" /><atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/relationships" href="http://localhost:8080/alfresco/cmisatom/200a3d48-6a94-4cb7-b1bd-186eb6be0c4e/relationships?id=workspace%3A%2F%2FSpacesStore%2F77acb21f-811c-49a3-be4d-5cc7f177f461" type="application/atom+xml;type=feed" /></atom:entry>
It is valid XML.
It is a Mono bug. Mono crashes on <xsd:choice>.
See https://bugzilla.xamarin.com/show_bug.cgi?id=2907
Sub-answer:
You are using the old Alfresco CMIS URL.
Check:
http://localhost:8080/alfresco/service/cmis/index.html