question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CompileBinding are unable to bind to nested property of generic class.

See original GitHub issue

Using Avalonia 11.0.999-cibuild0030320-beta.

Set this in csproj

<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>

Add a ComboBox with SelectedItem binding.

Run.

System.BadImageFormatException: An attempt was made to load a program with an incorrect format.

In my project, I was having the error at compile-time, but I reproduced it in the blank template project and this time the error shows up at runtime instead. No idea why. I was also having another error that I’m unable to reproduce, but it could be directly related to this.

I created a repo project here Avalonia11-CompileBinding.zip

OS: Garuda Linux

Issue Analytics

  • State:open
  • Created 7 months ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mysteryx93commented, Feb 26, 2023

OK added x64 to the solution. Getting the exact same behavior.

0reactions
maxkatz6commented, Feb 28, 2023

We can’t nicely fallback from compiled bindings to reflection bindings on the flight. But developers can use ReflectionBinding in these places explicitly. If same members are used in the code (and I assume they are, since it’s CurrentItem, probably used somewhere), it won’t be trimmed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript: Using nested generic class type
I am trying to use a nested class type generic. Let's say I have the following code: class Base { property: string|undefined; }...
Read more >
Bind to nested (navigation) properties in complex objects
Bind to nested (navigation) properties in complex objects. Description. I bind the Grid to Data with complex objects in its model, not only...
Read more >
Type.GetNestedTypes Method (System)
GetNestedTypes (BindingFlags). When overridden in a derived class, searches for the types nested in the current Type, using the specified binding constraints.
Read more >
Compiled Bindings
If you use compiled bindings and the property you bind to is not found, you will get a compile-time error. Hence you get...
Read more >
TypeScript Utility: keyof nested object
In this blog post, we will learn how to build a TypeScript util type, that exposes all the key paths of an object,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found