NT8 Unhandled exception: cannot access tmp file (being used by another process) + scripts not showing in UI (Indicators/DrawingTools/AddOns)

Hi all,
I’m a long-time NinjaScript developer (6+ years) and I’m running into a strange issue on my usual Windows 10 PC after coming back from a break.

Main issue:
Whenever I try to import/install any NinjaScript (indicator / drawing tool / addon), NinjaTrader throws an error like:
“Unhandled exception: The process cannot access the file ‘C:\Users\Alejandro\Documents\NinjaTrader 8\tmp’ because it is being used by another process.”

It can also happen on startup (tmp-related error).

Odd behavior / secondary issue:
Even when the .cs/.dll files end up inside:
C:\Users\Alejandro\Documents\NinjaTrader 8\bin\Custom
the scripts do NOT appear where they should:

  • Indicator not listed in Indicators
  • Drawing tool not listed in DrawingTools
  • AddOn not listed under Tools

So it looks like files are copied but scripts are not being compiled/loaded/registered.

What I tried:

  • Full uninstall + clean reinstall (multiple NT8 versions), registry cleanup, same behavior
  • Antivirus exclusions for Documents\NinjaTrader 8 folder
  • OneDrive / Google Drive sync disabled
  • Controlled Folder Access (Ransomware protection) is OFF

Key observation:
I can import indicators/drawing tools successfully only if I run Process Monitor (Procmon) as Administrator while importing. (and the imported indicators/drawing tools wont appear in the UI)
If Procmon is not running as Admin, the tmp error happens repeatedly.

Procmon capture (Admin) shows NinjaTrader.exe hitting a CreateFile on ...\tmp\XXXXXX with Result = SHARING VIOLATION (trying to open/delete/synchronize the tmp entry).

Questions:

  1. Any known Windows 10 security/indexing components that can intermittently lock NT8 tmp files under Documents?
  2. What’s the recommended way to diagnose why scripts end up in bin\Custom but don’t show in the UI (compilation/load failure)?
  3. Any NT8 settings/logs/trace files I should check for the underlying exception stack?

Happy to provide latest log/trace files if needed.

Plataform: Ninjatrader 8 8.1.6.2 64-bit

Thanks!
Ale

Do you have the full sysinternals package installed? There is a sysinternals utility called Handle that can show you you who has the file lock NT is colliding with. Here’s an article which explains how to track down the offender.

Since you mention things work when running as Admin, there may be a permissions issue with the NinjaTrader.Custom.csproj preventing indicators from being added correctly. I would start there and also look for something else locking that file (with the Handle utility).

1 Like