Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tons of unhandled exceptions in nt

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tons of unhandled exceptions in nt

    I tried to catch whatever unhandled exceptions were there in NT, with this code (from inside my addon):

    Code:
        ...
        AppDomain.CurrentDomain.FirstChanceException += HandleUnhandledException;
       ...
    
    public static bool inCatchAllLoop = false;
    public static void HandleUnhandledException(object  sender, object e)
            {
                if (!inCatchAllLoop)
                {
                    inCatchAllLoop = true;
                    var finalStr = "";
                    if (e is UnhandledExceptionEventAr gs)
                        finalStr = ((UnhandledExceptio nEventArgs)e).ExceptionObject.ToString();
                    else if (e is System.Runtime.Excep tionServices.FirstChanceExceptionEventArgs)
                        finalStr = ((System.Runtime.Ex ceptionServices.FirstChanceExceptionEventArgs)e).E xception.ToString();
                    else
                        finalStr = e.ToString();
    
                     try{
                        System.IO.File.Append("..myTempFile",  finalStr );
                    }
                    catch(Exception ex2){ }
                    inCatchAllLoop = false;  
                }
            }

    There has been tons of unhandled exceptions cought (though, 90% of them were just same error repeated 100's of times, like "coulndt find file Ninjatrader.Gui.Serializers... etc." )

    Could you debug NT app and fix all unhandled exceptions that live within NT (without other addons being a reason).

    #2
    Hello ttodua,

    Thank you for your post.

    If you are reporting a specific issue with NinjaTrader, we are happy to look into it following the steps needed to reproduce an issue. Subscribing to the FirstChanceException event may not mean that you are hitting an actual issue at all. We would suggest using the log tab of the Control Center to identify exceptions that may be an actual issue.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Well, I understand, however I see such occasions:

      Code:
      •System.IO.FileNotFoundException: Could not load file or assembly 'NinjaTrader.Gui.XmlSerializers, Version=8.0.23.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
      File name: 'NinjaTrader.Gui.XmlSerializers, Version=8.0.23.2, Culture=neutral, PublicKeyToken=null'
      at System.Reflection.RuntimeAssembly._nLoad(AssemblyN ame fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
      at System.Reflection.RuntimeAssembly.InternalLoadAsse mblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
      for years, NT team was ignorant for developers requests, and what was 7 years ago, that is still today.
      There are tons of cases, when in NT, we just get this:
      Click image for larger version  Name:	KSNxd1b.png Views:	0 Size:	4.8 KB ID:	1162059
      Click image for larger version

Name:	lRj6ae0.png
Views:	169
Size:	8.3 KB
ID:	1162060

      without any further info or trace detail to be available (i.e. show more details or whatever button in that NT error message).
      thats why it is necessary to waste hours to develop custom error-catcher.
      Yes, NT could have developer more helpful things for developers, but as is..

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X