Fix for “Unhandled Exception / Could Not Find a Part of the Path” When Importing Add-ons

If you’re running into issues importing third-party add-ons into NinjaTrader and getting errors like:

Unhandled exception: Could not find a part of the path…
or
Import failed. NinjaScript archive may contain duplicate method names…

There’s a high chance the problem is caused by OneDrive managing your Documents folder.

This is one of the most common and frustrating issues new NinjaTrader users face, especially when trying to import third-party indicators or strategies. OneDrive often interferes with the default NinjaTrader Documents directory, which leads to broken file paths and failed imports.

:white_check_mark: THE GOOD NEWS - I created a short and easy-to-follow Fix-It Video that walks you step-by-step through resolving this issue.

:wrench: In the video, I show you how to:

  • Identify if OneDrive is managing your Documents folder
  • Fix the path problem that’s preventing imports
  • Ensure future third-party add-ons install without errors

:television: Watch the Fix-It Video on YouTube here:
:backhand_index_pointing_right: https://youtu.be/buGh7Eo5OLk?si=NkPNCM8bVlM9ZiSY

Hope this helps you get up and running without any more headaches. Let me know in the comments if it worked for you!

4 Likes

I often hear that this annoying problem is caused by Microsoft OneDrive. But is it really?
I had the same issue on a brand new HP desktop without even using OneDrive.
I uninstalled the add-on and built my own indicators. When I later ran into a similar issue, it turned out to be a memory leak. After fixing that, I never had any problems again.

Just because your code compiles without errors doesn’t mean it’s 100% correct.
I’m not a programmer — this is just my personal experience.

Thanks for sharing your experience…always great to hear different angles to the same problem.
You’re right that just because code compiles cleanly doesn’t mean everything’s good. I’ve seen plenty of cases where the real culprit only shows up in the Log tab of the Control Center.

I’ll also make note of how you resolved it…fixing a memory leak is no small feat, and that insight could help someone else facing a similar issue down the line.

Appreciate you chiming in!