Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript must be in a compilable state to create or edit Strategies error

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

    NinjaScript must be in a compilable state to create or edit Strategies error

    So yesterday one of my strategies would uncheck itself when applied in the strategy window. Although the strategy compiled fine and even ran fine in the strategy analyzer the error I was getting was something about accessing an index out of range. I searched the forums and followed some advice to enable debug mode and open the strategy script in Visual Studio where I compiled it, set a breakpoint and reviewed it, then removed it and successfully ran the strategy with no error for hours with no changes made.

    Today however again, no changes made whatsoever but when I fire up Ninjascript editor I get the above error and was unable to open any of my scripts. I had however saved the workspace with a few other scripts open and when trying to compile those I get this error:

    Source file '\\Mac\Home\Documents\NinjaTrader 8\bin\Custom\obj\Debug\.NETFramework, Version=v4.8.AssemblyAttributes.cs' could not be found. The error code in the next column is CS2001.

    I checked and yes, there's no such file.

    Besides wondering how I can resolve this issue, my questions is also why did this error start happening? What happens between the handoff to VS Studio 2002 and then closing that solution that now breaks NinjaScript Editor so effectively.

    Things I have already tried which have not worked:

    1. Making sure the Debug Mode is unchecked on all open scripts and recompiling
    2. Opening the code back in VS Studio 2022 and recompiling - it builds fine with no errors but the NinjaScript Editor remains broken.

    Edit: now tried building the entire NinjaTrader.Custom in VS Studio and I get 662 conflict warnings CS0436. Pic attached.


    Any suggestions?

    Click image for larger version

Name:	Screen Shot 2022-09-15 at 8.30.16 AM.png
Views:	192
Size:	456.6 KB
ID:	1215629
    Attached Files
    Last edited by markdshark; 09-15-2022, 07:34 AM.

    #2

    Comment


      #3
      Hello markdshark,

      Attempting to compile in Visual Studio will break NinjaTrader by generating an AssemblyAttributes.cs file.

      Do not compile in Visual Studio. Compile only in NinjaTrader's Ninjascript Editor.

      The NinjaScript Editor also monitors files for changes. If you save 'Ctrl + s' a script in any editor, including Visual Studio, while the NinjaScript Editor is open, this will automatically trigger NinjaTrader to compile.

      Just save the script in the external editor while the NinjaScript Editor is open. Do not compile with an external editor.

      To resolve the error delete the 'Documents\NinjaTrader 8\bin\Custom\obj' folder.

      Below is a link to a google search of 'AssemblyAttributes' which lists forum threads where this is discussed.
      https://www.google.com/search?q=site...mblyAttributes
      Last edited by NinjaTrader_ChelseaB; 09-15-2022, 09:10 AM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Thank you that solved it!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,404 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        95 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        7 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        159 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X