Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader developers: Your .NET platform targets (x86 vs x64) are not aligned

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

    NinjaTrader developers: Your .NET platform targets (x86 vs x64) are not aligned

    Hi NinjaTrader Developers,

    In a recent NT upgrade I see that you have change NT to now only target x64 CPU architecture. Also, binaries are now installed to C:\ProgramFiles instead of C:\Program Files (x86). Great.

    However the NinjaTrader.Custom.csproj (and possibly the entire NT codebase) is still referencing the x86 .NET assemblies. You can see this when you configure references in the NinjaScript Editor:

    Click image for larger version

Name:	Default NinjaScript x86 NET references.png
Views:	133
Size:	26.6 KB
ID:	1233217

    Visual Studio also warns you of this issue when you build the NinjaTrader.Custom.csproj project. Here are the warnings when targeting "Any CPU":

    Click image for larger version

Name:	Visual Studio warnings when building Custoim project against Any CPU platform target.png
Views:	104
Size:	42.5 KB
ID:	1233218

    And here are the warnings when targeting x64:

    Click image for larger version

Name:	Visual Studio warnings when building Custoim project against x64 platform target.png
Views:	103
Size:	16.5 KB
ID:	1233219

    I tried replacing the x86 .NET references with the x64 .NET references in the NinjaScript Editor but NT puts the x86 .NET references back in and fails to compile because there are now both x86 and x64 .NET assembly references:

    Click image for larger version

Name:	Overwriten NinjaScript x64 and x86 NET references.png
Views:	111
Size:	79.7 KB
ID:	1233220

    It is not good practice to mix target CPU architectures in an application. That's why Visual Studio gives these build warnings when doing so, and in particular "This mismatch may cause runtime failures."

    Please, if you're going to explicitly target the x64 CPU architecture in your NT codebase (and NinjaTrader.Custom.csproj) please can you also target the x64 .NET framework (C:\Windows\Microsoft.NET\Framework64) and not the x86 .NET framework (C:\Windows\Microsoft.NET\Framework)?

    Thanks you in advance for your consideration.


    #2
    Hello tcdouglas,

    You cannot build the NinjaTrader Project in Visual Studio.

    Just save your script with the NinjaScript Editor open, and this will cause NinjaTrader to automatically compile.

    Attempting to build the project in visual studio will cause this error.

    See the forum post below about resolving.
    I installed the latest version of NT8. I have all updates of Windows 10 installed. I have also the latest version of Visual Studio. When I compile from the Ninjascript editor it works fine. When I use VS and want to build in VS, I am getting the following error in the NinjaScript Editor: \NETFramework,version=v4\6\1AssemblyAttr
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    639 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    572 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X