Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
UltraDockManager - Loading Invalid Dock Layout Crashes Application
posted

I'm using UltraDockManager to manage docking layouts for my application. It seems that the docking file got corrupted or save incorrectly and the dock manager cannot import the file now.

              try
              {
                 if (File.Exists(_fractionDockLayout) == true)
                     dockManager.LoadFromXML(_fractionDockLayout);
                }
                catch(Exception ex)
                {
                    Logging.Logger.Warning("Error loading the fractions docking layout: " + ex.Message);
                }

Even with the LoadFromXml call inside a try/catch block with a generic exception handler, the application crashes as soon as the LoadFromXML line is run. Turning on exception breaking in Visual Studio, I can see that the error is "System.ArgumentException: Height must be greater than 0px.'

We are using WinForms, Infragistics 2017.1, targeting .NET 4.0

How can I recover gracefully from this situation so my application can still run without having to go manually delete the layout XML file?