Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Importing Compiled Scripts

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

    Importing Compiled Scripts

    I exported a script using the Compiled version with 21. I have RemoteSoft so I compile protected code. Now, I tried installing that on two other systems also running 21 using the import process and both failed. I also tried not using the protected assemblies option and got the same results.

    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 PC or in the import archive.

    However, if I export that indicator without protecting the assembly (meaning just source code), it imports fine.

    Now, I tried three different indicators, one wasn't even written by me.

    #2
    Hi Bob, what Protector version are you using with B21? Supported would only be the 3.1 release at this time.

    Thanks

    Comment


      #3
      when you export your .cs files to a compiled assembly and you reimport that assembly again you will have duplicate methods, because all methods exist in both the .cs file and in the compiled archive.

      Therefore choose which codebase to use: Or the source (cs) or the assembly (.dll)

      regards
      andreas
      www.zweisteintrading.eu

      Comment


        #4
        Protector is not the issue. It worked in previous versions before 21. Besides, if I DON'T use protector as I indicated, it still doesn't work. But, to answer your question, I'm using 4.0 which that builds also included 3.1. Now, looking at the ZIP file that NT creates, I see no other DLL in there for the Protector. Does NT now ship with that DLL?

        ZWeisten - in the archive, there is a .cs file that is included, but that just looks like namespace directives, etc., no source code in there.

        Comment


          #5
          Bob, this is unfortunately not correct - please have a look here at the Protection/ DLL / Security section - 4.0 is not supported, it's mandatory to downgrade to the 3.1 version - http://www.ninjatrader.com/support/h...nt7/export.htm

          Comment


            #6
            Bertrand, as I indicated I already have 3.1 installed (4.0 is the GUI explorer). But, to make sure, I uninstalled 3.1, then re-installed it. I exported a script. I deleted the source script from my system. I then imported it in, it worked fine.

            However, when I sent this to a friend of mine on the same 21 version, they get the failure error as indicated before.

            To help you out, see if you can import this indicator. Its a compiled assembly using Protector.
            http://www.screencast.com/t/YjdiNTlhNWEt This is a ZIP file so choose Download Media.

            Comment


              #7
              Bertrand, any update?

              Comment


                #8
                bobcat70,

                Your script does not install through the importer so I manually installed it then ran the NinjaScript Editor to compile. The attached screenshot shows the errors that come up with your DLL.

                The most common cause for this is if you have not included all required components with the export. Please ensure you include all dependencies into the assembly when you export. Basically the errors say it is using something that it cannot find on the other machine. It works on your machine because you still have those other required components installed and so there are no issues installing on yours.
                Attached Files
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh:

                  Okay, those are assemblies on my system, but are NOT part of the exported script. Why or how would the DLL know about scripts that are not part of the exported script itself? Why would the script that I'm exporting need to reference another script that it doesn't even use?

                  Comment


                    #10
                    Any update?

                    Comment


                      #11
                      Bob, sorry for the late reply - all scripts are compiled into one assembly, hence the references need to fit as well. We suggest you export your custom assembly from a clean setup containing only the system indicators and custom ones you wish to include in the assembly.

                      Comment


                        #12
                        Bertrand, you are telling me, that if I compile one indicator, ALL INDICATORS in my list of indicators are in that compiled assembly? I don't understand what you mean by "all scripts are compiled into one assembly". Shouldn't it be just the ones I select?

                        For example: http://screencast.com/t/MmE0ZjQ4ZW

                        If that is all I did, how would you know about the other indicators?

                        BTW, this all used to work in a previous NT version before 21 - which one, i don't know. I'm not sure how to load a previous NT version.
                        Last edited by bobcat70; 09-21-2010, 10:03 AM.

                        Comment


                          #13
                          Bob, I could reproduce an issue here - we're looking into it.

                          Comment


                            #14
                            Bob, we looked into and this is unfortunately how the assemblies interact with each other - we recommend therefore exporting from a 'clean' setup to not run into those issues.

                            Comment


                              #15
                              What do you mean, clean setup?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              606 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              353 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              561 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X