Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Questions about the References dialog in the NT8 editor

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

    Questions about the References dialog in the NT8 editor

    1. How do I add references like the ones at the top of the dialog, where no path is necessary?

    Click image for larger version  Name:	image.png Views:	15 Size:	66.0 KB ID:	1275773

    A DLL like System.Web.dll exists on my machine in over 100 locations. Which is the right one? I've been choosing the matching x64 version in the Global Assembly Cache (GAC), but this puts a long bizarre path in front of the DLL name. So I've been wondering if there is a best practice for which place to get these DLLs from? And thinking perhaps if I had the "correct" place, it would be from the same place as those DLLs at the top of the References dialog that have no path. Where is that?

    2. I've noticed that if I manually add references to the .csproj file, NT8 will whack them when I build from within the NT8 editor. This implies that the DLLs in the References dialog are stored in a location other than the .csproj file itself and then used to emit the .csproj file. So where would that be? Is there a registry key or a file location somewhere I can edit?

    There are a variety of circumstances where editing these in a text editor would by faster, say if I move a directory I am depending on for multiple DLLs.

    Cheers.
    Last edited by carnitron; 11-01-2023, 02:31 PM.

    #2
    Hello carnitron,

    To add .net references you need to manually edit the config file and ad them like the others are in the references node. First exit NinjaTrader and then make a copy of the file Documents\NinjaTrader 8\config.xml. After doing that open config.xml in a text editor like notepad, not microsoft word. With the file open you can search for the term <reference> and that will bring you to the section that contains the references. After that you need to add a new node into the list just like how the other references are defined. Here is an example:

    <string>System.dll</string>

    adding references to the .csproj will fail because NinjaTrader controls the .csproj file, all references need to be added through the NinjaScript editor or in the case of .net assembles manually in the config file.



    Comment


      #3
      Ok, that was super useful advice, thank you. I've now significantly cleaned up my references as a result.

      Those references at the top without a path? Where do they point to? The appropriate GAC for the build target?

      Do you have any guidelines about which place is the best to pull a particular DLL from?

      I noticed that a number of them come from Microsoft.NET\Framework\v4.0.30319. Is this whatever .NET Framework version NT8 has been built again in this release?
      Last edited by carnitron; 11-01-2023, 02:31 PM.

      Comment


        #4
        Hello carnitron,

        .net references can be specified as a filenames in this context because of the "global assembly cache" which can correctly delegate the path for the needed reference to the application.

        For .net references you should always use just the filename by manually editing the config. NinjaTrader gets updated to newer C# versions which may use different library versions so specifying the library name only will ensure that the correct version is used for the application.

        Comment


          #5
          Ok thanks Jesse, that's exactly what I needed to know. Cheers!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          69 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          42 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          24 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          27 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          54 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X