• 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

Reference external libs from NinjaTrader.Custom

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

    Reference external libs from NinjaTrader.Custom

    In my lib csproj I edit and used

    Code:
    <PropertyGroup>
        <PostBuildEvent>xcopy /E /Y "$(TargetFileName)" "$(registry:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell [email protected])\NinjaTrader 8\bin\Custom"
    xcopy /E /Y "$(TargetName).pdb" "$(registry:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell [email protected])\NinjaTrader 8\bin\Custom"</PostBuildEvent>
      </PropertyGroup>
    I can see the external lib in Documents\NinjaTrader 8\bin\Custom folder together with other addons and NinjaTrade.Custom.dl. However NT cannot find it the assembly

    #2
    from further investigation I can tell that when I compile through NinjaScript editor the external libs reference in NinjaTrader.Custom.csproj file are removed? Can I somehow tell NT not to replace that file?

    Comment


      #3
      Hello,

      Thank you for the post.

      Could you provide more detail on what you are specifically trying that is not being found? I am unsure by what has been provided what the exact problem is currently.

      It sounds like you have used the Build Events from the example Visual Studio solution here?

      Is there an error with some code you are trying when NinjaTrader compiles? Could you provide an image or more detail on the specific problem?



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

      Comment


        #4
        there was a problem with nugets but I solve it however the major problem is that
        every time you recompile from the Compile button in NinjaScript editor the external lib references are removed from NinjaTrader.Custom.csproj so it cannot compile

        Comment


          #5
          Hello,

          Yes this would be expected the custom project is regenerated when you compile. You would need to use an external visual studio project if you want to use nuget or other more advanced solution options.

          We have an example of creating a NinjaScript DLL in a separate project here: http://ninjatrader.com/support/helpG...t_overview.htm

          the "AddOn Development Environment (Visual Studio Advanced)" contains a download for a whole solution which also contains the build event to copy the DLL. This solution file would be unchanged by compiling NinjaTrader because it is in a separate folder/solution. You should not directly edit the NinjaTrader.Custom.csproj file as this is used internally specifically.

          This would reference the core files needed when creating NinjaScript items, you are free to add other references but keep in mind any references you add will also need to be added using the NinjaScript editor -> Right Click -> References menu.

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

          Comment


            #6
            where does NinjaScript Editor stores the references for the project? Can I add more somehow without using the Add Reference Script Editor menu?

            Comment


              #7
              Hello,

              These are stored in the Config file, but editing this file outside of the platform is advised against. The only supported/suggested way to add references is manually using the Editor.

              For development, you can just add the references manually once and then you don't have to do anything further.

              Once you export a NinjaScript assembly for other users to import, you can use the AdditionalReferences.txt file to include your assemblies in the final importable zip. When exporting you can select the other references to include and follow the instructions in the help guide to create a zip file with all resources in it.

              http://ninjatrader.com/support/helpG..._procedure.htm

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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by iceman2018, Today, 09:56 PM
              0 responses
              3 views
              0 likes
              Last Post iceman2018  
              Started by iceman2018, Today, 09:51 PM
              0 responses
              3 views
              0 likes
              Last Post iceman2018  
              Started by linacesaro, Today, 09:17 PM
              0 responses
              3 views
              0 likes
              Last Post linacesaro  
              Started by n8dogg59, Today, 06:55 AM
              2 responses
              17 views
              0 likes
              Last Post n8dogg59  
              Started by pstrusi, Today, 03:29 PM
              2 responses
              10 views
              0 likes
              Last Post pstrusi
              by pstrusi
               
              Working...
              X