Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Machine-independent NinjaTrader.Custom.csproj

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

    Machine-independent NinjaTrader.Custom.csproj

    So I have my NT8 dev environment on several machines now, and unfortunately, I have had to put the project on different drives, depending on the machine.

    This means the drive letters that NT8 puts into the .csproj "fight" with one another, when I check my NinjaTrader.Custom.csproj into and out of my central repository in GitHub. For instance, this Reference:

    <Reference Include="System.ValueTuple">
    <HintPath>C:\Documents\NinjaTrader 8\bin\Custom\packages\...\System.ValueTuple.dll</HintPath>
    </Reference>


    actually needs to be this (note the E: drive) on another machine:

    <Reference Include="System.ValueTuple">
    <HintPath>E:\Documents\NinjaTrader 8\bin\Custom\packages\...
    \System.ValueTuple.dll</HintPath>
    </Reference>


    I have worked around this with an environment variable "MyProjectDir" that I set on each machine to point to the base "C:\Documents" or "E:\Documents" directory.

    This results in a reference like so:

    <Reference Include="System.ValueTuple">
    <HintPath>$(MyProjectDir)\NinjaTrader 8\bin\Custom\packages\...
    \System.ValueTuple.dll</HintPath>
    </Reference>


    This compiles fine in Visual Studio 2022, ofc, b/c it is very common technique for handling this problem.

    But I cannot make this work with the NT8 Config.xml file

    If I replace:

    <string>*MyDocuments*\NinjaTrader 8\bin\Custom\packages\...\System.ValueTuple.dll</string>

    with any of the following

    <string>*MyProjectDir*\NinjaTrader 8\bin\Custom\packages...
    <string>%MyProjectDir%\NinjaTrader 8\bin\Custom\\packages
    ...
    <string>$(MyProjectDir)\NinjaTrader 8\bin\Custom\\packages
    ​...

    the project file that NT8 generates on load is messed up and loses the full path entirely.

    How do I solve this problem in the NT8 ecosystem?


    (Note that I cannot use *MyDocuments*, b/c I need to use NT8 and OneDrive on the same machine, so I have had to take the extraordinary measures I have documented at the bottom of the page here:
    https://forum.ninjatrader.com/forum/...-session/page2)
    Last edited by carnitron; 01-16-2025, 02:27 AM.

    #2
    Hello carnitron,

    This would be outside of what is supported by NinjaTrader.
    We only support the environment folder within Documents.

    This thread will remain open for any community members that would like to provide advice and experience.


    I would suggest that you work the .gitignore file so this ignores all system files and only includes your custom scripts and templates.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok, I'll probably just live with it for now. It's an annoyance, but not a real productivity drain or a blocker.

      I'm not sure how much work and difficulty might come from trying to run with a solution and project that are NOT checked in while some portion of their files ARE checked in.

      (Not trying to be difficult here, it's just that in my 30+ years of development experience, I've never been in a situation where people don't check in the project and solution files. There are too many bits of important project definition and configuration data to not have everyone be in sync there. So what you are suggesting here is highly unusual, in a broader development sense.)
      Last edited by carnitron; 01-16-2025, 01:22 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      39 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X