Import failed. File may contain duplicate method

If you are getting an error message whilst trying to import any of our products, like 'Import failed.The NinjaScript Archive file may contain duplicate method names that already exist on your PC , modify a method signature that other scripts were dependent.......', then please check the below:

NinjaTrader aborts the import whenever compilation of the archive fails. The most common reason is that the archive introduces a type that already exists in your bin/Custom tree. You already have Same Product or some class or enum with same name in the workspace, so importing another copy of the same tool or which has same class or enum triggers the duplicate‑definition check and produces the “duplicate method names” error.

a. Please make sure you are not storing your NinjaTrader 8 Folder within any cloud storage like One drive, google drive or something similar. If you are make sure you keep the NinjaTrader folder and our prducts files our of that.

b. Then follow below:

  • Open NinjaTrader
  • From the Control Centre select the New menu--> select NinjaScript Editor
  • Click at the top of the window "Compile" button, like the screenshot.
  • If there is any compilation error, at the bottom of the NinjaScript Editor window, a new section will appear where you can find the error locations
  • If the error is related to our product which you were trying to import, then move to below point C. If the error is related to other 3rd party product, then you should contact them.

image


c. Remove the existing product file first: in NinjaTrader open Tools → NinjaScript Editor, navigate to the product → delete the product, and press F5 to compile so the cache is clean. Then retry Tools → Import → NinjaScript Add‑On… with the import zip file downloaded.

d. If you can't find it there, then check and remove the product from NinjaTrader 8 Control Centre > Tools > Remove NinjaScript Assembly > click on the product and then click Remove. Then compile in NinjaScript Editor and restart your platform. Then try to import again.

e. If you still face the same, then you can rename the product which is creating the error or remove it, then compile. That should resolve the issue. 

f. But if you don't want to remove any of them, then open the import zip file, copy and paste the .cs/.dll files into the correct location. For .dll and reference files, possible correct location is Documents\NinjaTrader 8\bin\Custom and for a .cs files, it would be Documents\NinjaTrader 8\bin\Custom then choose the Drawing Tool or Indicators or Strategies folder and any relevant subfolders. Then compile again using NinjaScript editor and if it shows any error, then that needs to be addressed.

f. If you still see the dialog after removing the file, open the Documents\NinjaTrader 8\log\log*.txt entry created at the time of the import; It should provide more info and send them to us to investigate further. Please follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.

  • Open your NinjaTrader folder under My Documents.
  • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
  • Send the 2 compressed folders as attachments to the ticket from below.
  • Once complete, you can delete these compressed folders.

If you find your files are too big to send through email, please upload them in Dropbox or any other cloud storage and send us the link by creating a ticket by clicking Submit a ticket and please mention the name of the Product and your NinjaTrader 8 version in subject/body of the ticket. If you still get the compilation error from NinjaScript Editor above after following all steps above, then please also attach a screenshot of that to your ticket. We would investigate and reply to your ticket with possible guidance.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article