Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error when trying to import an encrypted script

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

    Error when trying to import an encrypted script

    I have installed CliSecure to protect a compiled assembly, and when I try to import it I get the following error.
    Import NinjaScript Archive File (.zip) Error
    ---------------------------
    Import failed. The NinjaScript Archive File may contain duplicate method names that already exist on your PC or there is a required file missing on either your PC or in the import archive.
    ---------------------------

    If I export the file without encryption there is no issue importing.

    I have tried to encrypt, export, and then import three different scripts. All exported from the same machine, but imported on three distinct machines.

    Any suggestions as to what I might need to do in order to be able to encrypt a file, and then allow someone else to use it?

    #2
    Adamdetx,

    You won't be able to import the assembly to a system that also has the base development files on it. You would need to import this to an installation that does not have your development files.

    Since the development "unprotected' files exist, and this protected assembly contains them, you are getting duplicate classes / method names and the compiler is not sure how to separate them.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply. I think I have addressed that issue, but when I try to compile the assembly now I notice that it is trying to include an indicator that I used in the code at one time, but have since removed. Searching the code with the search and replace tool yields no results for the indicator. Any suggestions for how to remove an indicator that I can't see in the code?

      Comment


        #4
        Is there an error when you compile related to that indicator? Is the error listed in orange or yellow? If you double click on the error, does it take you to a line in the current file you're trying to compile, or does it open a new window?
        MatthewNinjaTrader Product Management

        Comment


          #5
          No, there's no error. Everything compiles fine, except that when I try to export it an extra indicator is called into the assembly.

          Comment


            #6
            Problem solved. I had referenced the extra indicator in an indicator so it wasn't showing up in the script, but still included in the assembly. Thanks again for the assistance.

            Comment


              #7
              Similar error on import

              Hi Adam,

              Please explain your statement:

              "You won't be able to import the assembly to a system that also has the base development files on it. You would need to import this to an installation that does not have your development files.

              Since the development "unprotected' files exist, and this protected assembly contains them, you are getting duplicate classes / method names and the compiler is not sure how to separate them."


              I'm using a strategy with my own indicator referencing two of the basic NT indicators - RSI and SMA.
              Now, when I try to export this to generate a protected assembly, the target NT already has these two indicators, which creates the duplication conflict.
              According to your suggestion, I would need to remove these indicators either from my NT setup before exporting the assembly, or from the target NT. Is it correct?
              Or may be the solution provided by Adamdetx is cleaner in a way that you don't need to remove anything?

              Thanks. bkool.

              Comment


                #8
                Similar error on import

                Anyone's comment will be appreciated....

                Comment


                  #9
                  bkool, so you're seeing this with only the NT system indicators used? The would have an @ in front.

                  Those would not be affected from the duplicate methods conflict, this would be for custom indicators and all assemblies you have installed. Here we suggest to export to assembly from a dev machine that would only hold the NT default references.

                  We've also seen cases where open source indicators were used in an assembly project - here you would definitely need to rename since the target machine could have those installed open source and thus it would generate an issue with the methods attempted to be installed from the assembly then.

                  Comment


                    #10
                    Thanks Bertrand.
                    So can you say that if there is any conflicting indicator, it would just be enough to rename it?

                    Comment


                      #11
                      Correct, you would need to ensure it's using a unique name, so no duplicate could be detected.

                      Comment


                        #12
                        As a followup-question to a similar problem, if I want to export an indicator to a compiled .DLL, and that indicator depends on another non-system indicator, is there some way to tag that second one such that it will not appear in the indicator selection dialog within NinjaTrader? (Assume I give the second indicator a very unique name, I just don't want it showing up at all on the machine importing the assembly)

                        Comment


                          #13
                          johanps68, that would unfortunately not be possible per default - would suggest you include the needed methods and calcs directly in your custom script then for example.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          648 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          369 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          108 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          572 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          573 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X