BindingListView
BindingListView copied to clipboard
Dynamic comparison functions under .NET 5.0
It looks like the dynamic code generation for comparison generates an invalid IL code. I tried this for the Foo example for sorting on the Abscissa. The function private static Comparison<T> BuildValueTypeComparison( PropertyInfo pi, ListSortDirection direction )
returns in invalid IL code.
Hi @AteCoder Sorry, I don't maintain this code anymore and I haven't used it in years. Feel free to make a fork and fix it up - I'll be glad to put a link in this repo's README to point to yours.
Hi @waynebloss thank you for your reply.
Could you give me a hint on how I can see the IL that is created by the BuildValueTypeComparison
function? I can than compare the 4.72 and 5.0 code and report this to MS.
@AteCoder Here's the code that generates the intermediate language - https://github.com/waynebloss/BindingListView/blob/ae7143356c7d3a49e4b3434bf09ffbc8d401fb44/src/BindingListView/AggregateBindingListView.cs#L1478
Here's some info on how to debug it:
- https://stackoverflow.com/questions/321203/how-do-i-debug-il-code-generated-at-runtime-using-reflection-emit
- https://stackoverflow.com/questions/56043204/is-there-a-way-to-view-dynamicmethod-resulting-x86-assembly-code
- https://www.google.com/search?q=.net+DynamicMethod+GetILGenerator+debug+il
Super! I'll give it a shot.
Hi @AteCoder Sorry, I don't maintain this code anymore and I haven't used it in years. Feel free to make a fork and fix it up - I'll be glad to put a link in this repo's README to point to yours.
Hi @wayneblooss. Why did you stop keeping it? Or do you use another tool?
@danielvega I don't do a lot of WinForms anymore. Mostly I am doing web and mobile frontends, if any...