What can cause a form not to close itself? - winforms

I wonder just what can cause a form not to close.
I have a big form, with several TabControls, DataGridViews and many DataBound-Controls, at least 10 BindingSources are involved. (Thats the point why I can't post my code here, sorry).
Now, I have the problem, that somewhere in development (just refaktoring) the form stopped closing correctly. When I click on the Close-Button (Red-Cross-Box) I goes through FormClosing and FormClosed but then nothing more happens. VisualStudio2008 with debugging and halt on all Errors when thrown doesn't event mention something went wrong, the form just stays where it is.
What could cause such a behavior? It is NOT that e.Cancel in the FormClosing-Event is set!
After step by step merging my changes to another clean working copy, the form closes correctly, but an exception is thrown:
ArgumentNullException with Message: "The value cannot be null. Parametername: component". It is thrown in Form.Designer.Dispose upon calling the base.Dispose(disposing) line.
Seems to be something with the DataBinging, any hints welcome.
I'll put in the StackTrace, it is really any of the DataBound Controls, from what I understand out of the StackTrace, it is a TextBox - I do not get Framework Source Stepping enabled, so I can not figure out what TextBox breaks here.
bei System.ComponentModel.ReflectPropertyDescriptor.RemoveValueChanged(Object component, EventHandler handler)
bei System.Windows.Forms.BindToObject.CheckBinding()
bei System.Windows.Forms.Binding.CheckBinding()
bei System.Windows.Forms.Binding.SetBindableComponent(IBindableComponent value)
bei System.Windows.Forms.ControlBindingsCollection.ClearCore()
bei System.Windows.Forms.BindingsCollection.Clear()
bei System.Windows.Forms.ControlBindingsCollection.Clear()
bei System.Windows.Forms.Control.ResetBindings()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.Windows.Forms.TextBox.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.Windows.Forms.TabControl.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Control.Dispose(Boolean disposing)
bei System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
bei System.Windows.Forms.Form.Dispose(Boolean disposing)
bei My.BaseForm.Dispose(Boolean disposing) in BaseForm.Designer.cs:Zeile 30.
bei My.InheritedForm.Dispose(Boolean disposing) in InheritedForm.Designer.cs:Zeile 25.
bei System.ComponentModel.Component.Dispose()
bei System.Windows.Forms.Form.WmClose(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Alright, got it, with Framework source stepping working (why ever it is so complicated) I could figure out what databinding failed. It was a databinding to a property of an object that was null at runtime. Thanks for the help.
PS: I'm sorry for those getting angry about me, but i stated this question explicitly for not getting those all-day answers. It is nice to remind me of these possible failures, but if I do state that it is not with this, don't be childisch to pretend on this.

I think one of your 10 binding sources has an error (in one of your many databound controls) and isn't releasing you from a field somewhere. VS isn't very transparent if there are errors in databinding and problems do get silently swallowed.
Although, if this is the case:
When I click on the Close-Button (Red-Cross-Box) I goes through FormClosing and FormClosed
then that somewhat contradicts my theory.
Why not try decoupling the databinding piece by piece and seeing if you can then close the form?

an example of how to prevent a form to be closed:
protected override void OnFormClosing(FormClosingEventArgs e)
{
e.Cancel = true;
base.OnFormClosing(e);
}
maybe this form is inherited and a base class prevent the form closing when some conditions are not satisfied.
Finally, if you don't achieve any solution, you can debug through the .NET Framework code and see what happens in the your form's OnClosing method.

Form can be prevented from closing even from your Form_Closing event handler.
private void Form1_Closing(Object sender, CancelEventArgs e)
{
e.Cancel = true;
}
Check whether you're setting e.Cancel to true .. anywhere in the code which is preventing it from closing.

Related

Elusive WPF Exception related to ToolTip

I have deployed a version of my (rather complex and sizeable) WPF Application and a few users (not all of them) encounter the following Exception.
FEHLER: Bei dem angegebenen Element handelt es sich bereits um das logische untergeordnete Element eines anderen Elements. Führen Sie zuerst eine Trennung durch.
bei System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
bei MS.Internal.FrameworkObject.ChangeLogicalParent(DependencyObject newParent)
bei System.Windows.FrameworkElement.AddLogicalChild(Object child)
bei System.Windows.Controls.ContentControl.OnContentChanged(Object oldContent, Object newContent)
bei System.Windows.Controls.ContentControl.OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
bei System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding)
bei System.Windows.Controls.PopupControlService.RaiseToolTipOpeningEvent()
bei System.Windows.Controls.PopupControlService.OnRaiseToolTipOpeningEvent(Object sender, EventArgs e)
bei System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
The english version of the exception message is:
Specified element is already the logical child of another element. Disconnect it first.
My main Problem is,
a) that I am not able to reproduce this on my development machine.
Which does not mean it does not occur under the same circumstances, rather the users all say independently that the Exception occurs at no specific point in time, action or state of the software.
b) none of the above calls are actually referring to my own code.
So I guess it must be somewhere in the XAML
I am completely lost and in hope of some pointers in a rough direction where to look.
EDIT: I have now been able to reproduce and isolate the problem
Demo Application
The Demo Application reproduces an Exception that will occur when a complex ToolTip (anything but a String Object) is placed on an Element (Button) which is in turn placed on a Popup.
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<ToggleButton x:Name="_PopUpToggle" Content="Open Popup"/>
<Popup
IsOpen="{Binding ElementName=_PopUpToggle,Path=IsChecked}"
Placement="Bottom"
>
<Grid Background="Wheat">
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Button
Content="StackPanelToolTip"
Click="Button_Click">
<Button.ToolTip>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Not "/>
<TextBlock Text="Plain"/>
</StackPanel>
</Button.ToolTip>
</Button>
</StackPanel>
</Grid>
</Popup>
</Grid>
To reproduce start the application, open the Popup, mouseover the first button, wait until the ToolTip appears and click. Repeat. This produces the following Exception with the corresponding TraceStack:
Bei dem angegebenen Element handelt es sich bereits um das logische untergeordnete Element eines anderen Elements. Führen Sie zuerst eine Trennung durch.
bei System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
bei System.Windows.FrameworkElement.AddLogicalChild(Object child)
bei System.Windows.Controls.ContentControl.OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
bei System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding)
bei System.Windows.Controls.PopupControlService.RaiseToolTipOpeningEvent()
bei System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
The english version of the exception message is:
Specified element is already the logical child of another element. Disconnect it first.
Binding the ToolTip to a plain String Object (try the second Button) does work without any issue. This is my current workaround.
As pointed out by Mathew, enclosing the Complex Content of the ToolTip-Property in <ToolTip></ToolTip> resolves the issue.

NullReferenceException from PresentationFramework.dll

I'm fighting with a strange NullReferenceException that is apparently fired from the GetNameCore() function of the ItemAutomationPeer class.
The details of the exception are below but the really intriguing aspect is that it doesn't occur on my development machine running Windows 7, or other Windows 7 computers we have tested with. It only happens on my Windows 8 Pro test machine.
The exception is thrown apparently when attempting to edit a cell in a WPF DataGrid control.
I've been trying to track it down all day without success. I tried debugging the process remotely using Visual Studio and stepping through the code but none of the user code seems to be triggering the exception. It's obviously executed by a sequence of events inside of the PresentationFramework.Dll and the exception just bubbles up through the AppDomain and eventually crashes the application.
If anybody can think of anything that might be causing this, or a way to fix it it would really help.
Exception Type: System.NullReferenceException
Exception Message: Object reference not set to an instance of an object.
Method Information: System.String GetNameCore()
Exception Source: PresentationFramework
Stack Trace
at System.Windows.Automation.Peers.ItemAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
After a lot of back-and-forth with the remote debugger, and nearly fruitless searches online I was able to track down the issue to a couple of miss-behaving ItemAutomationPeer instances.
When I ran into this issue I had zero knowledge about UI Automation and how it is supported in the WPF framework. In fact, when AutomationPeer had me thinking of COM interop for some reason so I chased the wrong issue for a while. If you are reading this and don't know what UI Automation is perhaps starting here and here might give you an idea as far as what UI Automation means in the context of WPF.
In my case, it turns out that the reason why the application was crashing on the Windows 8 test machine yet it was working fine on my development machine (and countless other computers that it had been deployed to) was that the Windows 8 machine had some sort of UI accessibility application (or some other UI Automation client) running. As soon as I started the Narrator application on my Windows 7 development machine I was able to get the app to crash just the same..
Once I understood the root problem, I still was unable to further debug this to find out exactly which control was causing the problem but more reading online seemed to point in the general direction of custom controls and so I started a process of elimination to determine which custom WPF controls were guilty. I found two custom controls - one that extended a DataGrid, and another that extended a ListBox.
Finally, the solution to the problem in my case was to create custom classes that extend the ItemsControlAutomationPeer base class and to provide those as automation peers on each of the custom controls that had issues by overriding the OnCreateAutomationPeer method.
protected override AutomationPeer OnCreateAutomationPeer()
{
return new ControlSpecificCustomAutomationPeer(this);
}
Where the ControlSpecificCustomAutomationPeer class might looks something like this at the very least:
public class ControlSpecificCustomAutomationPeer
: ItemsControlAutomationPeer
{
public ControlSpecificCustomAutomationPeer(ItemsControl owner)
: base(owner)
{
}
protected override string GetNameCore()
{
return ""; // return something meaningful here..
}
protected override ItemAutomationPeer CreateItemAutomationPeer(object item)
{
return new CustomDummyItemAutomationPeer(item, this);
}
}
public class CustomDummyItemAutomationPeer
: System.Windows.Automation.Peers.ItemAutomationPeer
{
public CustomDummyItemAutomationPeer(object item, ItemsControlAutomationPeer itemsControlAutomationPeer)
: base(item, itemsControlAutomationPeer)
{
}
protected override string GetNameCore()
{
if (Item == null)
return "";
return Item.ToString() ?? "";
}
protected override AutomationControlType GetAutomationControlTypeCore()
{
return System.Windows.Automation.Peers.AutomationControlType.Text;
}
protected override string GetClassNameCore()
{
return "Dummy";
}
}
This issue for me was reliably reproducible with turning on Narrator and scrolling in a treeview that was using virtualisation with VirtualizationMode set to Recycling. Setting it to Standard led to a very slight performance hit, but the crash no longer occurs.
I chose to catch the error and handle it as a 'non-fatal' error.
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
if (e.Exception.Source?.ToString() == "PresentationFramework")
{
e.Handled = true;
Postgres.LogException(e.Exception, false);
return;
}
HandleException(e.Exception);
e.Handled = true;
Shutdown();
}
FYI, this bug will be fixed in a future release of .Net 4.8.
https://developercommunity.visualstudio.com/content/problem/575165/vs-1604-ide-crash-argumentnullexception.html

Causes of intermitant Arg_ArgumentException on in Production deployment?

We have just recently deployed a Trusted, In-Browser, Silverlight 5 application to our Production webserver. We are getting fairly frequent ArgumentExceptions captured by the App.xaml.cs UnhandledException handler. So far we have been unable to determine the source of the exception.
We are not seeing the exception when running under the debugger (I have that explicitly enabled the exception for capture under Debug->Exceptions....). Some users see this error very frequently, while others never see the error. It doesn't seem to be a fatal error as the users can just click the OK button from the ErrorWindow that we display and everything functions normally.
To stop annoying the users, I have added a handler for ArgumentException types and just mark it as handled and continue on. However, I am still logging the errors and would really like to determine the actual source so that I can fix the problem. Just ignoring the exception doesn't seem like a long term solution.
The Stack trace is below and is the same for all ArgumentExceptions.
Any ideas on how I can troubleshoot better and determine the cause of this exception?
Thanks,
Tim
Unhandled Exception: [Arg_ArgumentException]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.10411.00&File=mscorlib.dll&Key=Arg_ArgumentException :
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, Double d)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.PerformTargetLoaded()
at System.Windows.Data.BindingExpression.TargetLoaded(Object o, RoutedEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex

System.Windows.FrameworkElement.Style

got an exception when i call a silverlight xap in sharepoint. Hope anybody can help me out this problem. Here the exception:
Message: Unhandled Error in Silverlight Application Set Property
'System.Windows.FrameworkElement.Style' threw an exception. [Line: 84
Position: 335] at System.Windows.Application.LoadComponent(Object
component, Uri resourceLocator) bei
Project.MainPage.InitializeComponent() bei
Project.MainPage..ctor(String eldoradoUrl, String eldoradoUser) bei
Project.App.Application_Startup(Object sender, StartupEventArgs e)
bei MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex,
Delegate handlerDelegate, Object sender, Object args) bei
MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr
unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex,
String eventName)
And here is the xaml code line where the error supposed:
<fseld:EldoradoDocCreationView x:Name="ProtoEldoradoDocCreationView" Grid.Row="0"
MaxColumnCount="2" FieldMargins="34 5 5 5"
RestrictToProperties="ProcedureName, FileItemText"
CurrentItem="{Binding ProtoEldoradoDoc}" CommandButtonsVisibility="None"
Margin="25,18,47,0" FontSize="10" Height="69" VerticalAlignment="Top" />
Thanks for your replies in advance !
Does your Silverlight XAP work outside of Sharepoint? If no first correct the error outside, you will easier isolate the problem and may get more detailed exception information.
If it does work without Sharepoint then rather look at external assemblies that could contain styles that are not found in this context.

Silverlight Application Error 0x17F8 on ComboBox_DropDownOpened

I have several similar comboboxes with custom templates that display one custom control on the dropdown. Suddenly one of those controls have broken and they give me the following error when I open the combobox.
Message: Unhandled Error in Silverlight 2 Application Error 0x17F8. Debugging resource strings are unavailable. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50401.0&File=mscorrc.dll&Key=0x17F8 at <INSERT_NAMESPACE>.ComboBox_DropDownOpened(Object sender, EventArgs e)
at System.Windows.Controls.ComboBox.OnDropDownOpened(EventArgs e)
at System.Windows.Controls.ComboBox.OnIsDropDownOpenChanged(Boolean isDropDownOpen)
at System.Windows.Controls.ComboBox.OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.DependencyObject.SetValue(DependencyProperty property, Boolean b)
at System.Windows.Controls.ComboBox.ElementDropDownToggle_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Primitives.ToggleButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
Line: 1
Char: 1
Code: 0
As you can see this only happens in deployed release versions and on the machines with no development environments. The same release version (and debug version) is working on my development machine.
I wrapped everything on the DropDownOpened event handler inside a try-catch-block to get more information but the catch doesn't fire at all.
I tried to Google the error but so far haven't found anything that would be helpful. Any advice how to start solving this? Could this be related to Silverlight runtime version or something that should be installed on the release machines as well?
I managed to solve the issue. I installed Developer Runtime to the machine for the hope that it would reveal better error message from the Exception. And it did! The issue was in the code of the control that was being displayed in the combobox dropdown. I fixed the bug and it's now working fine. Apparently even the strangest error message can mean the simplest thing :)
I wonder if there is a drawback on having the developer runtime instead of the standard runtime?

Resources