• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Import DLL failed

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

    Import DLL failed

    Hello,
    My colleague cannot import the DLL I am sending to him (attached image Import.DLL.failed.png) : "Import failed. etc"

    The DLL contains strategies and the custom indicators that the strategies are using(attached image Archive.files.png)

    The reference file , AdditionalReferences.txt, has the following content:
    System.dll
    System.ComponentModel.DataAnnotations.dll
    System.Core.dll
    System.Net.Http.dll
    System.Web.Extensions.dll
    System.Windows.Forms.dll
    System.Xaml.dll
    System.Xml.dll
    System.Xml.Linq.dll
    Microsoft.CSharp.dll
    *Windows*\Microsoft.NET\Framework\v4.0.30319\WPF\W indowsBase.dll
    *Windows*\Microsoft.NET\Framework\v4.0.30319\WPF\P resentationCore.dll
    *Windows*\Microsoft.NET\Framework\v4.0.30319\WPF\P resentationFramework.dll
    *Windows*\Microsoft.NET\Framework\v4.0.30319\WPF\U IAutomationProvider.dll
    *ProgramFiles*\NinjaTrader 8\bin64\InfragisticsWPF4.DataPresenter.v15.1.dll
    *ProgramFiles*\NinjaTrader 8\bin64\Infralution.Localization.Wpf.dll
    *ProgramFiles*\NinjaTrader 8\bin64\NinjaTrader.Core.dll
    *ProgramFiles*\NinjaTrader 8\bin64\NinjaTrader.Gui.dll
    *ProgramFiles*\NinjaTrader 8\bin64\SharpDX.dll
    *ProgramFiles*\NinjaTrader 8\bin64\SharpDX.Direct2D1.dll
    *MyDocuments*\NinjaTrader 8\bin\Custom\NinjaTrader.Vendor.dll


    I see this message when I create the ZIP containing the DLL, CS and
    reference TXT (attached image Export.warning.png)

    What would be the steps for me to take to track down the issue? Thanks
    Attached Files

    #2
    Hello utilizator,

    It appears that you are attempting to add references that are already included in NinjaTrader by default and should not be added to the additionalreferences.txt file.


    Also, to confirm, you are sending a .zip file that was exported from NinjaTrader 8, is this correct?

    And you have checked the additional references you need within the export window and you have attempted to modify the file manually is this correct?

    Is this for NinjaTrader 7 or for NinjaTrader 8?
    (NT7 scripts cannot be imported into NT8 and NT8 scripts cannot be imported into NT7)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,
      My NT is 8.0.14.1 64-bit while my colleague's is 8.0.14.2 64-bit
      I exported as DLL and I did not modify the references TXT file that NT8 created.

      I recorded the actions I made to create the ZIP, please find the movie at https://app.box.com/s/1ctkkexax2xpqzjz8yv7ooona9adnh5n

      How should I do it correctly? thanks

      Comment


        #4
        Hi Chelsea,
        Also related to this thread:
        my colleague would need to remove all custom code from his system before trying to import the DLL I am sending to him.
        Besides the folders/Indicators and /Strategies, are there any other places where he should look for custom DLLs and CSs? thanks

        Comment


          #5
          Hello utilizator,

          The majority of those references are not necessary to add.

          Can you create a script that calls the same references and indicators with the logic removed and export this so I may analyze the export?

          If so, please attach this with your next post.

          If not, please send an email to platformsupport [at] ninjatrader [dot] com so that I may request this privately.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi Chelsea,
            I removed the logic from indicators and strategies, they do compile OK.
            I exported them as CS and DLL(separate ZIPs, of course); please download them from https://app.box.com/s/orboxk8y0ipocld3ssznw96o0g7x9tp9
            thanks

            Comment


              #7
              Hello utilizator,

              From what you have provided, it doesn't look like you need to include any references to dlls at all.

              Just check the box for your strategy and try and export. Any open source .cs files the export needs nt should automatically include.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hi Chelsea,
                When I try to export (DLL or CS) without references, I get an error and the ZIP is not created, please see the attached image and log

                However, the CS file in question is named JW_^_retracement.cs while the class inside is named JW_A_retracement. Could this be the reason for this error? If so, what I should rename to what?
                thanks
                Attached Files

                Comment


                  #9
                  Hello utilizator,

                  I always recommend that the class name match the file name. Not doing so can cause confusion with users who may be importing the script.

                  Also I recommend not using any special characters that are not underscores (meaning letters and numbers only), and also the class and file name should start with a letter and not a number.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Chelsea,
                    I made the change in the files' names. Can you import then now? archives at https://app.box.com/s/i5v3xc9ghcwf8pg9zlocbdrssus05xkz
                    I am still asked to add NT8 indicators, please see attached image.

                    Also, in case I want to remove an imported DLL, how should I do that? To what folder the imported DLLs are stored? thanks
                    Attached Files

                    Comment


                      #11
                      Hello utilizator,

                      Yes, the .cs files that are needed are being automatically added with that message. Click Yes.

                      To remove a third party assembly package please:
                      • Click Tools -> Remove NinjaScript Assembly...
                      • Select the assembly to remove -> click the Remove button

                      To remove open source indicators:
                      • Click New -> NinjaScript Editor -> select to expand the Indicator folder
                      • Right-click the indicator by name -> select Remove

                      To remove an open source strategy:
                      • Click New -> NinjaScript Editor -> select to expand the Strategies folder
                      • Right-click the strategy by name -> select Remove
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Chelsea,
                        Thank you for the useful information.

                        My colleague still could not import my DLL archive, please see his attached screenshots.
                        Were you able to successfully import my archives on your side? thanks
                        Attached Files

                        Comment


                          #13
                          Hello utilizator,

                          Were you wanting me to test the old ones that have all of the unnecessary references added?

                          Or did you want me to test the new export you have just created?
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Chelsea,
                            I mean the latest, with no references and with the corrected file names, https://app.box.com/s/i5v3xc9ghcwf8pg9zlocbdrssus05xkz
                            thanks

                            Comment


                              #15
                              Hello utilizator,

                              The open source version imported ok. The dll exported did not.

                              https://drive.google.com/file/d/1L-g...w?usp=drivesdk

                              The error I got was:
                              7/31/2018 12:13:55 PM Default Error compiling import assembly: c:\Users\user\Documents\NinjaTrader 8\bin\Custom\Test.cs(190,45) : error CS0246: The type or namespace name 'instrumentType' could not be found (are you missing a using directive or an assembly reference?)

                              What error did you get?

                              Most likely you have added objects to a custom namespace and you are attempting to include the namespace with a using statement instead of using the fully qualified namespace.

                              If you have done this, remove the using statement and use a fully qualified namespace.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NinjaCustomer, Today, 10:06 AM
                              3 responses
                              6 views
                              0 likes
                              Last Post NinjaTrader_JoshG  
                              Started by crabman777, Today, 09:52 AM
                              3 responses
                              12 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by Arkadiy_B, Today, 06:43 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post Arkadiy_B  
                              Started by leontancfa, Today, 06:09 AM
                              1 response
                              15 views
                              0 likes
                              Last Post NinjaTrader_PatrickG  
                              Started by soulfx, 12-01-2017, 08:44 AM
                              3 responses
                              1,023 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Working...
                              X