Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

why UI.xml is being used by another process ?

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

    why UI.xml is being used by another process ?

    Hello,

    What could have caused the unhandled exception in the screenshot?

    After the window pop-out I closed NT8, from Control center , but NinjaTrader.exe remained present in Task Manager. I had kill the process from Task Manager.

    In the trace file, attached, we read

    Code:
    System.IO.IOException: The process cannot access the file 'C:\Users\wzeml\Documents\NinjaTrader 8\UI.xml' because it is being used by another process.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
    at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
    at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
    at NinjaTrader.Gui.Tools.NTWindow.<GetSizableBorder>b __90_1(Object sender, MouseButtonEventArgs _)
    at System.Windows.RoutedEventArgs.InvokeHandler(Deleg ate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandle r(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Objec t source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.ReRaiseEventAs(Dependency Object sender, RoutedEventArgs args, RoutedEvent newEvent)
    at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
    at System.Windows.RoutedEventArgs.InvokeHandler(Deleg ate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandle r(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Objec t source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(Dependency Object sender, RoutedEventArgs args)
    at System.Windows.UIElement.RaiseTrustedEvent(RoutedE ventArgs args)
    at System.Windows.Input.InputManager.ProcessStagingAr ea()
    at System.Windows.Input.InputManager.ProcessInput(Inp utEventArgs input)
    at System.Windows.Input.InputProviderSite.ReportInput (InputReport inputReport)
    at System.Windows.Interop.HwndMouseInputProvider.Repo rtInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
    at System.Windows.Interop.HwndMouseInputProvider.Filt erMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at System.Windows.Interop.HwndSource.InputFilterMessa ge(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.Internal RealCall(Delegate callback, Object args, Int32 numArgs)
    at System.Windows.Threading.ExceptionWrapper.TryCatch When(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    Note: The attached excerpt from the trace file does not contain any sensitive info.

    Thank you.

    Attached Files

    #2
    Hello utilizator,

    Are there some steps which cause that to happen?

    Based on the error it seems something on your PC was accessing the file when NinjaTrader tried to.

    Comment


      #3
      Thank you Jesse for your reply.

      According to the trace file, a trade closed normally at
      09:06:11:736
      No actions from the part of the strategy script after that -- i.e. no orders or any other script-triggered action.

      At 09:18:19:517 the error happened.

      I am not aware of anything on my PC that could try to access the UI.xml file.

      If this was a random NT8 malfunction, that cannot be make sense of, would it be possible for my script to be informed? Perhaps the script could check the Control Center > Messages tab at every OnBarUpdate, or by some other way?

      Thanks.

      Comment


        #4
        Hello utilizator,

        That seems unrelated, the UI file is not used for trading its mainly settings for the UI. The timestamps are also not at the same time so I would not expect those to relate.

        If you have anything running on the PC besides NinjaTrader that accesses the documents directory its possible that was the cause.

        Comment


          #5
          Thank you. Would it be possible for my script to be informed? Perhaps the script could check the Conntrol Center > Messages tab at every OnBarUpdate, or some other way?

          Comment


            #6
            Hello utilizator,

            No that would not be a NinjaScript event so your script would not be aware of that.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            56 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            133 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            73 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X