samc
Topic Author
Posts: 74
Joined: 21 Aug 2019, 19:22

best way to track down this error: 'Converter<Brush>' binding converter failed to convert value

05 Jan 2023, 20:45

Hi,

I'm using Unity with Noesis and I've just upgraded to 3.1.6. I'm seeing a lot of errors that were perhaps hidden before, that look like this:
[NOESIS/E] 'Converter<Brush>' binding converter failed to convert value '' (type 'String')
I'm nearly certain that this is just a problem in my XAML. We have a string to brush converter that is probably just missing somewhere (not sure if this is the best way to do this - but we use it to convert string values like #ff00ff to a Brush using Brush.Parse()). The problem I'm having is just understanding where I should start to look.

The full call stack for these errors looks something like this:
[NOESIS/E] 'Converter<Brush>' binding converter failed to convert value '' (type 'String')
0x00007ff6a0449c9d (Unity) StackWalker::GetCurrentCallstack
0x00007ff6a044ed69 (Unity) StackWalker::ShowCallstack
0x00007ff6a141b081 (Unity) GetStacktrace
0x00007ff6a1ad7412 (Unity) DebugStringToFile
0x00007ff69f3e7586 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x00000219c4b2545a (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x00000219c4b252cb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000021b7a7598ce (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object,UnityEngine.Object)
0x0000021b7a75964b (Mono JIT Code) UnityEngine.Debug:LogError (object,UnityEngine.Object)
0x0000021b7a758bfb (Mono JIT Code) NoesisUnity:UnityLog (int,string) (at /RemotePackages/unity-noesis/Packages/com.noesis.noesisgui/Runtime/NoesisUnity.cs:357)
0x0000021bf918a943 (Mono JIT Code) (wrapper native-to-managed) NoesisUnity:UnityLog (int,intptr)
0x00007ffdd989cef3 (Noesis) Noesis_RegisterLogCallback
0x00007ffdd962692d (Noesis) 
0x00007ffdd965930a (Noesis) TemplateBindingExpression_TemplateBindingExtension_get
0x00007ffdd9658f67 (Noesis) DependencyProperty_GetUnsetValue
0x00007ffdd963bbda (Noesis) ULong_GetStaticType
0x00007ffdd965419e (Noesis) DependencyProperty_GetUnsetValue
0x00007ffdd963b8fa (Noesis) ULong_GetStaticType
0x00007ffdd96c467c (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96bcb59 (Noesis) Int32Rect_GetStaticType
0x00007ffdd96c20f4 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9666500 (Noesis) ManipulationStartingEventArgs_SetManipulationContainerHelper
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97077bb (Noesis) ManipulationDeltaEventArgs_CumulativeManipulation_get
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9661f76 (Noesis) Thickness_GetStaticType
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd9705d41 (Noesis) ManipulationDeltaEventArgs_CumulativeManipulation_get
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9666500 (Noesis) ManipulationStartingEventArgs_SetManipulationContainerHelper
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9666500 (Noesis) ManipulationStartingEventArgs_SetManipulationContainerHelper
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9666500 (Noesis) ManipulationStartingEventArgs_SetManipulationContainerHelper
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9661f76 (Noesis) Thickness_GetStaticType
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9666500 (Noesis) ManipulationStartingEventArgs_SetManipulationContainerHelper
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96d4e0e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96d3fb9 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96d4e0e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96d3fb9 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd97749ed (Noesis) Boxed_Point_GetStaticType
0x00007ffdd97750c2 (Noesis) Boxed_Point_GetStaticType
0x00007ffdd9773b2c (Noesis) Boxed_Point_GetStaticType
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9661f76 (Noesis) Thickness_GetStaticType
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd986ba72 (Noesis) Decorator_Child_get
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd97b1edc (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96d3df9 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96d2d00 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96d3f6a (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96d4e0e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96d3fb9 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd9661f76 (Noesis) Thickness_GetStaticType
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd986ba72 (Noesis) Decorator_Child_get
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd96c2586 (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd96c231e (Noesis) BindingOperations_GetBindingExpression
0x00007ffdd97a8ad4 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd97b303f (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd97b2efb (Noesis) Noesis_RenderDevice_SetRenderTarget
0x00007ffdd97b15b3 (Noesis) Noesis_RenderDevice_SetRenderTarget
0x0000021bf931277d (Mono JIT Code) (wrapper managed-to-native) Noesis.View:Noesis_View_Update (System.Runtime.InteropServices.HandleRef,double)
0x0000021bf930b993 (Mono JIT Code) Noesis.View:Update (double) (at /RemotePackages/unity-noesis/Packages/com.noesis.noesisgui/Runtime/API/Core/View.cs:341)
0x0000021bf9300403 (Mono JIT Code) NoesisView:ExternalUpdateInternal () (at /RemotePackages/unity-noesis/Packages/com.noesis.noesisgui/Runtime/NoesisView.cs:1166)
0x0000021bf92eff83 (Mono JIT Code) NoesisView:ExternalUpdate () (at /RemotePackages/unity-noesis/Packages/com.noesis.noesisgui/Runtime/NoesisView.cs:1148)
..  my app code ...
Unfortunately, the majority of that stack is all native, so I can't really inspect it at all, and the outer NoesisVew is just our "root" xaml file that holds basically everything else.

Suggestions?

thanks,
sam
 
User avatar
sfernandez
Site Admin
Posts: 3008
Joined: 22 Dec 2011, 19:20

Re: best way to track down this error: 'Converter<Brush>' binding converter failed to convert value

09 Jan 2023, 17:09

Hi Sam,
We have a string to brush converter that is probably just missing somewhere (not sure if this is the best way to do this - but we use it to convert string values like #ff00ff to a Brush using Brush.Parse())
There is a default brush converter that already converts strings like "#FF00FF" into a Brush, so unless your converter has any more advance features I don't think you need to write your own. You can let the XAML parser or the binding system use that default converter if the source value is a string and the target is a brush property, so things like this will automatically work:
<Border Background="#FF00FF"/>
<Border Background="{Binding Color}"/> <!-- assuming Color property returns a string like "#FF00FF" -->
Regarding the binding error, there should be another error message with the binding details next to the previous one, something like:
[NOESIS/E] Binding failed: Path=Text, Source=TextBox('txt'), Target=Rectangle(''), TargetProperty=Shape.Fill
Aren't you getting any of those?
 
samc
Topic Author
Posts: 74
Joined: 21 Aug 2019, 19:22

Re: best way to track down this error: 'Converter<Brush>' binding converter failed to convert value

09 Jan 2023, 18:51

I'm not seeing that second error message - only the first! Could that be related to log level in settings? hmm

sam
 
User avatar
sfernandez
Site Admin
Posts: 3008
Joined: 22 Dec 2011, 19:20

Re: best way to track down this error: 'Converter<Brush>' binding converter failed to convert value

10 Jan 2023, 18:08

Hi Sam,

It seems that under some conditions the second error message is not produced, this is a bug in our binding code.
Could you please report it in our bugtracker? I will provide you a patched library for 3.1.6 version so you can get the binding information to help you find where the error occurred.

The default log level for bindings is to show all errors, so it should be enough in this case.

Who is online

Users browsing this forum: No registered users and 2 guests