Description
This issue has been moved from a ticket on Developer Community.
We detected a possible regression, as customers with an updated Windows Version to 1903 (to be exact, it is the recent Windows-Update, which installs .NET Framework 4.8, KB4486153) are experiencing a crash (InvalidCastException in on of our MultiValueConverter).
We've got a WPF-Binding-Scenario where we use a MultiValueConverter in a DataGrid in a WPF-UserControl, which is embedded in a WinForm.
The ViewModel - which is bound to the dataGrid - clears all used BindingLists when disposing.
Before KB4486153, the bindingList.Clear() didnt trigger the multivalueconverter to convert anything.
After KB4486153, the bindingList.Clear() triggers the mutivalueconverter with one parameter to be of type {DisconnectedItem} (in my case, it is the Item Property, which is bound to DataGridRow).
This is suprising, because as one of the changelog-items in .NET Framework 4.8 was as followed:
"Fixed an issue involving bindings with DataContext explicitly on the binding path. When DataContext changes to {DisconnectedItem}, the binding should not pass that value to user code like converters, property-change handlers, etc. [801039, PresentationFramework.dll, Bug, Build:3761]" .
**EDIT**:
Just found out that this line is the problem in .NET 4.8. The Converter is called with {DisconnectedItem} if the bound item is getting removed, if the the problematic binding is specified as followed:
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=DataGridRow, AncestorLevel=1}" Path="Item" />
If i change it to:
<Binding Path="." />
it works perfectly, even if we remove the item (or clearing the bindinglist) - the converter does not crash (or does not getting called).
But as this worked before 4.8 with a RelativeSource binding, this regression still should be checked.
I finally managed to create a small RePro which crashes with 4.8 (containing KB4486153) and does not Crash with 4.7.2 or earlier. Please have a look at it:disconnectedobject-repro.zip
Original Comments
Visual Studio Feedback System on 8/19/2019, 00:49 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Visual Studio Feedback System on 8/22/2019, 01:53 PM:
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2017#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.
Original Solutions
(no solutions)