• 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

Correct compilation of .cs but error importing .zip

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

  • ninjo
    started a topic Correct compilation of .cs but error importing .zip

    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:	1
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.


  • ninjo
    replied
    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 !





    Leave a comment:


  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • ninjo
    replied
    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

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by sergey_z, Today, 09:59 AM
0 responses
1 view
0 likes
Last Post sergey_z  
Started by TazoTodua, Today, 01:50 AM
3 responses
18 views
0 likes
Last Post NinjaTrader_Jesse  
Started by b16_aln, Today, 08:53 AM
1 response
20 views
0 likes
Last Post NinjaTrader_Kate  
Started by learningnt, Yesterday, 10:52 PM
1 response
10 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by U0000999, Today, 07:31 AM
5 responses
12 views
0 likes
Last Post U0000999  
Working...
X