Bug Report T500881
Visible to All Users

An exception thrown from a popup dialog unexpectedly terminates the whole application execution when debugging in Visual Studio

created 8 years ago

Debug the attached project and execute the Action from the Tools category:

C#
using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Actions; namespace T499468.Module.Win.Controllers { public class T499468 : WindowController { public T499468() { var popupWindowShowAction = new PopupWindowShowAction(this, "T499468", "Tools"); popupWindowShowAction.CustomizePopupWindowParams += popupWindowShowAction1_CustomizePopupWindowParams; } private void popupWindowShowAction1_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { throw new Exception("T499468"); } } }

This is specific to the debug mode only; everything operates correctly when running in Release mode without the attached debugger.

Answers approved by DevExpress Support

created 8 years ago

We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Show previous comments (8)

      Reproduced!

      Oddly, it's caused by another unrelated class. But seems to conflict somehow? Maybe you could tell me what's up?

      In Program.cs the call to TestClass.Instance.MyProperty is what will eventually cause this. More specifically, it's that I create and dispose of a WebBrowser control in this class to get the version.

      DevExpress Support Team 8 years ago

        Thank you for the update.
        I have investigated this scenario and found that it is caused by the Visual Studio and .NET Framework specifics.
        The Application.ThreadException event handler is not called if a Control object was created before a handler is added to this event:

        C#
        static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Control c = new Control(); //Comment Me Application.ThreadException += Application_ThreadException; Application.Run(new Form1()); }

        See the attached project for more details.

          It would of course be something stupid wouldn't it :) Thanks, Dan!

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.