Closed cofiem closed 7 years ago
[2014-11-21T00:25:47.4428900+00:00] FATAL - Unhandled exception ->
System.InvalidCastException: The result type 'null' of the dynamic binding produced by the object with type 'YamlDotNet.Dynamic.DynamicYaml' for the binder 'Microsoft.CSharp.RuntimeBinder.CSharpConvertBinder' is not compatible with the result type 'System.Nullable`1[System.Double]' expected by the call site.
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object) <IL 0x0008d, 0x002b6>
at (wrapper delegate-invoke) <Module>.invoke_bound_Nullable`1<double>_Closure_CallSite_object (System.Runtime.CompilerServices.CallSite,object) <IL 0x0003f, 0x00060>
at System.Dynamic.UpdateDelegates.UpdateAndExecute1<object, System.Nullable`1<double>> (System.Runtime.CompilerServices.CallSite,object) <IL 0x0012a, 0x0054d>
at (wrapper delegate-invoke) System.Func`3<System.Runtime.CompilerServices.CallSite, object, System.Nullable`1<double>>.invoke_TResult_T1_T2 (System.Runtime.CompilerServices.CallSite,object) <IL 0x00054, 0x000a1>
at AnalysisPrograms.AnalyseLongRecordings.AnalyseLongRecording.Execute (AnalysisPrograms.AnalyseLongRecordings.AnalyseLongRecording/Arguments) [0x004f5] in c:\Work\Github\audio-analysis\AudioAnalysis\AnalysisPrograms\AnalyseLongRecordings\AnalyseLongRecording.cs:100
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object) <IL 0x00052, 0x000d0>
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2<object, object> (System.Runtime.CompilerServices.CallSite,object,object) <0x00500>
at PowerArgs.ArgAction`1<AnalysisPrograms.Production.MainEntryArguments>.Invoke () <0x00484>
at AnalysisPrograms.MainEntry.Execute (PowerArgs.ArgAction`1<AnalysisPrograms.Production.MainEntryArguments>) [0x00045] in c:\Work\Github\audio-analysis\AudioAnalysis\AnalysisPrograms\Production\MainEntryUtilities.cs:173
at AnalysisPrograms.MainEntry.Main (string[]) [0x00058] in c:\Work\Github\audio-analysis\AudioAnalysis\AnalysisPrograms\MainEntry.cs:44
Looks like there is a problem with mono's support for casting. TODO: write a repo / submit an issue to YamlDotNet.Dynamic
Results of YamlDotNet.Dynamic tests on mono:
ubuntu@worker-1:~/bioacoustics/yaml-tests$ mono ./xunit/xunit.console.clr4.exe ./YamlDotNet.Dynamic/YamlDotNet.Dynamic.Test/bin/Debug/YamlDotNet.Dynamic.Test.dll
xUnit.net console test runner (64-bit .NET 4.0.30319.17020)
Copyright (C) 2013 Outercurve Foundation.
xunit.dll: Version 1.9.1.1600
Test assembly: /home/ubuntu/bioacoustics/yaml-tests/YamlDotNet.Dynamic/YamlDotNet.Dynamic.Test/bin/Debug/YamlDotNet.Dynamic.Test.dll
YamlDotNet.Dynamic.Test.DynamicYamlTest.TestDynamicYamlIsSerializeable [FAIL]
System.Runtime.Serialization.SerializationException : Type YamlDotNet.RepresentationModel.YamlSequenceNode is not marked as Serializable.
Stack Trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryCommon.CheckSerializable (System.Type type, ISurrogateSelector selector, StreamingContext context) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteValue (System.IO.BinaryWriter writer, System.Type valueType, System.Object val) [0x00000] in <filename unknown>:0
at DynamicYaml__TypeMetadata.WriteObjectData (System.Runtime.Serialization.Formatters.Binary.ObjectWriter , System.IO.BinaryWriter , System.Object ) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0
at (wrapper dynamic-method) object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,System.Runtime.Serialization.Formatters.Binary.BinaryFormatter,System.IO.MemoryStream,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[BinaryFormatter,MemoryStream,Object] (System.Runtime.CompilerServices.CallSite site, System.Runtime.Serialization.Formatters.Binary.BinaryFormatter arg0, System.IO.MemoryStream arg1, System.Object arg2) [0x00000] in <filename unknown>:0
at YamlDotNet.Dynamic.Test.DynamicYamlTest.TestDynamicYamlIsSerializeable () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
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
YamlDotNet.Dynamic.Test.DynamicYamlTest.TestNonexistingMember [FAIL]
System.InvalidCastException : The result type 'null' of the dynamic binding produced by the object with type 'YamlDotNet.Dynamic.DynamicYaml' for the binder 'Microsoft.CSharp.RuntimeBinder.CSharpConvertBinder' is not compatible with the result type 'System.String' expected by the call site.
Stack Trace:
at (wrapper dynamic-method) object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[Object,String] (System.Runtime.CompilerServices.CallSite site, System.Object arg0) [0x00000] in <filename unknown>:0
at YamlDotNet.Dynamic.Test.DynamicYamlTest.TestNonexistingMember () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
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
18 total, 2 failed, 0 skipped, took 0.601 seconds
This code is related and causing exceptions if the specified key is not found in the YAML
Closing as this never got fixed (Dynamic.Yaml is now unsupported, and we're planning to move away from using Dynamic for config files).