No announcement yet.

Partner 728x90


OneDrive Stopping Ability to Compile

  • Filter
  • Time
  • Show
Clear All
new posts

    OneDrive Stopping Ability to Compile


    As you read in the title, OneDrive has stopped my ability to compile new code. I have read a couple of other forum responses to this and they arn't working. I changed OneDrive to no longer sync the My Documents folder, uninstalled, and reinstalled NinjaTrader. I am still getting errors from compiling. NinjaTrader is now in the MyPc documents though.

    I attached the errors. What do I do now?


    Hello Stephen,

    The compile error you are seeing in the NinjaScript Editor indicates you are missing references to .DLL files in your installation or the .DLL files do not exist in your installation. Please follow the steps below to rectify the errors.
    1. From the Control Center please select New--> NinjaScript Editor
    2. In the NinjaScript Editor please right click and select References.
    3. In the Reference window look for the .DLL file reference in the compile error by name (PricePercentInRow.dll)
    4. If you see the .DLL file reference, please left click on the reference and select Remove
    5. If you removed the reference in the previous step or you do not see the .DLL file reference, then please select Add
    6. The Add option will open a File Explorer, from the path that was opened please locate the .DLL file
    7. If you find the .DLL please left click to select it and then select Open--> then select OK in the References window--> then right click in the NinjaScript Editor--> select Compile
    8. If you do not find the .DLL in the File Explorer please close the File Explorer and References windows--> then navigate to Documents\NinjaTrader 8\bin\Custom on your PC--> and delete the .cs file referenced in the compile error--> then right click in the NinjaScript Editor--> Compile
    JasonNinjaTrader Customer Service


      Thanks Jason.

      The DLL is not in Step 3, and there is nothing to add in Step 5 when I go to \bin\custom\indicators, which I assume is the location I'm supposed to go since it is an indicator. For the final step I go to the same custom\indicators folder and sure I can delete that file, but that is the custom codes I wrote so I'm just starting from scratch and throwing out all of my code.

      After I uninstalled and reinstalled Ninja 8 I just copied the custom programs I had in \bin\custom\indicators to the new folder location. Is that correct or did I need to copy something else over? Perhaps that was the error, I don't know how to get my old indicators, etc. back. I could delete all the custom and get it to work, but then I have to rewrite all the code. Hope what I'm saying makes sense.



        Do I need to copy over NinjaTrader.custom.csproj maybe? That's the only other place in my old folder I see reference to the new code. Thanks.


          Normally I would instruct you to contact the 3rd party vendor of the indicator to request a new .dll file, so you can restore the .dll reference. Does this indicator not have a .dll file? If you search in Windows for "PricePercentInRow.dll", are you able to find it? I'm not a programmer myself, so I'm not that familiar with creating custom indicators.

          If you don't have a .dll file, you could transfer the .cs file outside the Documents-->NinjaTrader 8 folder instead of deleting it. I think that also solves the compiling error.

          I'm not sure if copying over this file will solve the issue. You could try it. I see it holds all the default references such as System.dll, System.ComponentModel.DataAnnotations.dll, etc. Please make sure NinjaTrader is shut down when you do so. Subsequently start NinjaTrader and compile.

          JasonNinjaTrader Customer Service


            There's no 3rd party vendor. I designed code in Ninjatrader. Because Ninjatrader uses the One Drive documents folder to store code, once One Drive starting syncing it starting modifying or deleting code. Basically, Ninjatrader uses the One Drive documents folder and this will eventually just screw up all code somebody has written.

            I'm not concerned about compiling errors, I'd like to be able to use my code.

            It's absolutely amazing that Ninjatrader hasn't fixed the issue of storing data in One Drive. It's also amazing there are not clear steps to say how to transfer our your old codes. This must be happening fairly often to people, so I don't get why there are no answers. I have seen other forum posts around the One Drive issue, but not yet one that addresses your custom codes no longer working.

            Basically, I'll have to rewrite all of my code. This seems outrageous. If a similar thing happens in the future would I then have to rewrite potentially 50 programs? Weird.

            Should I be posting this in a different forum? Maybe that's the issue. I'd think this is a standard question based on how Ninjatrader uses the One Drive Documents folder.


              Hello GoodTradingFun,

              Thank you very much for your reply.

              Our platform, like nearly all Windows applications, saves its data in your local (My) Documents folder. This folder is a Windows default.

              As OneDrive then remapped the default folder, every program using the Documents folder would now be saved within the OneDrive folder instead of the regular Documents location.

              Microsoft OneDrive handles backups differently than most backup providers. When OneDrive backs a file up it will temporarily write-block the file.

              If NinjaTrader (or any other application) then attempts to access a file it no longer has access to, errors occur. This would explain why your code could not be saved or would reset.

              The only way to resolve this is to keep OneDrive from backing up your Documents, or specifically, your NinjaTrader folder within the OneDrive/Documents folder.

              To exclude a folder from backing up via OneDrive, please see the following, publicly available guide:


              How to disable OneDrive on Windows 10:


              Once OneDrive has been disabled or uninstalled, please reinstall NinjaTrader. This will ensure that all of its files are replaced, in case any of them were modified by OneDrive.

              With this procedure, you will not lose any Workspaces, Charts, custom items, etc.

              Please let me know, should you still experience any issues after performing these steps.
              Manfred F.NinjaTrader Customer Service


              Latest Posts


              Topics Statistics Last Post
              Started by ラリー, 10-05-2022, 02:10 PM
              3 responses
              Last Post ラリー  
              Started by hbolorin, Yesterday, 01:05 PM
              2 responses
              Last Post hbolorin  
              Started by rblunsom, 02-15-2019, 12:19 PM
              6 responses
              Last Post Bullseye  
              Started by rasdaka, Today, 01:38 AM
              0 responses
              Last Post rasdaka
              by rasdaka
              Started by Spiderbird, 10-03-2022, 10:15 PM
              3 responses
              Last Post Spiderbird