Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Correct compilation of .cs but error importing .zip

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

    Correct compilation of .cs but error importing .zip

    Hi

    I have a strange problem importing.

    Ninjatrader 8 (8.0.17.2) return the next alert when I try to import my own .zip protected compiled assembly in other PC:
    (I payed a license Agile.net from secure team)


    Click image for larger version

Name:	import.failed.PNG
Views:	359
Size:	6.5 KB
ID:	1058419


    This error does not occur if I copy the original .cs file and compile in the other PC.
    Then, the compilation is ok and the indicator works in the chart.


    What happend? How could I install in other PCs my protected indicators without this error?

    Thank you.


    #2
    Hello ninjo,

    Is the .cs file also on that PC when you tried to import this? If so, the error would be correct, the source code or .cs file needs to first be removed from that PC.

    If you do not have the source code imported, this could be for other reasons. You can manually import and reference the DLL to view the errors it produces. Before going through this process, can you confirm have you exported this from your trading installation which has custom items imported? If so, there is a chance some of those items were included by accident. It is always suggested when exporting compiled assemblies to do that from a development installation which only contains your custom item, and nothing third party.

    Please try the following steps to create a clean install and re export the item from that installation, this will let you know if something third party was included in the other export.

    To create a clean installation to export your NinjaScript objects from please follow the instructions below:
    1. Go to Help > License Key and copy and paste your License Key into a text document
    2. Export the code you want as the final export as source code
    3. Exit the platform
    4. Go to (My) Documents > rename the 'NinjaTrader 8' folder to 'NinjaTrader 8.Prev'.
    5. Then re-install from the following link: http://ninjatrader.com/GetStarted

    When you reinstall it will recreate the user folder you had just renamed with only stock files.

    Now you can start the platform and import the source code for the item you want to export as a compiled assembly. Because there are no other items in this installation, only the item you want to export would be included.

    To switch between the two installs; shut down NinjaTrader > rename the new installation to 'NinjaTrader 8.Dev' under (My) Documents > then rename the 'NinjaTrader8.Prev' to 'NinjaTrader 8'. NinjaTrader looks for the user folder named NinjaTrader 8 specifically.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse,

      No .cs in the other PC. Its a new PC with a new Ninjatrader 8 installation


      This error not occur with all imported indicators. The difference is that the "problematic" indicator has a public class declared ...
      The error occurs too when I compiled without the protected option checked (only the "Export as compiled..." )

      Do you think the problem will be solved if I delete and reinstalll all Ninjatrader 8? (saving the Indicators folder of course )

      Thank you

      Comment


        #4
        Hello ninjo,

        This error not occur with all imported indicators.
        Correct, we are just speaking about your item that you have exported here. You mentioned that your item cannot import, my reply is in contrast to your custom export.

        The difference is that the "problematic" indicator has a public class declared ...
        All indicators should have their class as public, if you mean that you created another class inside of your indicator as public that should be ok too. You would generally have a problem during an export if the public class was an issue. Without seeing a sample of what you are specifically referring to here, I can only guess that this is not the specific problem.

        The error occurs too when I compiled without the protected option checked (only the "Export as compiled..." )
        Do you think the problem will be solved if I delete and reinstalll all Ninjatrader 8? (saving the Indicators folder of course )
        If the problem is happening with compiled assemblies protected or not, using the clean install steps I provided in the last post would be a good starting point at addressing the problem. You wont lose any data, you just make a secondary user folder used for exports only. When you export with other third party items imported in your installation, there are some cases which those items are included even if you don't select them. This is a good test to confirm if that is happening. The error you pictured is what you will see if something was accidentally included that should not be.

        If you still see the error when exporting from a clean install, you could use the following steps to manually reference the DLL to gather the error messages:
        1. Extract the zip file so that you see the .dll files and .cs file.
        2. Copy all .dll and .cs files into the folder: Documents\NinjaTrader 8\bin\Custom
        3. Using the NinjaScript editor, right click and go to references
        4. Add the dll you copied, generally this will be the one with x64 in its name if you are using the 64 bit NinjaTrader.
        5. Click OK to close the references and the re compile.
        6. You can reverse these steps to remove the files once you have checked for errors. You will need to close NinjaTrader to be able to delete the .dll files.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hello Jesse,

          I solved the problem with your last recommendation. Amazing trick !
          ( I think its not necessary to reference the .dll. The automatic compilation show the .cs errors )

          Thank you !





          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by andrewtrades, Today, 04:57 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          3 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          6 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X