只是为了澄清一下,我已经临时解决了这个问题,只是想看看是否有人可以详细说明为什么会发生这种情况,并可能给我一些关于如何永久解决它的见解。我正在为 AutoCAD 构建一个插件,但遇到了一些 RadioButtons 的问题
我设置了一组 RadioButtons 的 GroupName 属性,这样我就可以独立于不同的组来控制它们。现在,当我在发布和调试模式下调试应用程序时,应用程序可以工作,但是当我将我的 .dll 网络加载到 autocad 以检查它在调试模式之外的执行情况时,我单击 8 个单选按钮之一并导致 autocad 崩溃(我不担心关于那个),我得到了它抛出的异常如下:
the thread tried to read from or write to a virtual address for which it does not have the appropriate access
以及抛出它的部分代码:
at System.Windows.Controls.RadioButton.UpdateRadioButtonGroup()
at System.Windows.Controls.RadioButton.OnChecked(RoutedEventArgs e)
at System.Windows.Controls.Primitives.ToggleButton.OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
现在我真的不明白为什么它在调试之外不起作用。有人可以尝试给我一些见解吗?
作为我GroupName
从 RadioButton XAML 中删除的临时修复。如果您需要任何来源,请询问。