Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
NT Version (8.1.2.0) import error with a protected compiled assembly
Collapse
X
-
Hello sidlercom80,
Thanks for your notes.
I am not aware of any changes in NinjaTrader 8.1.2.0 in regard to how enums work in NinjaScripts compared to NinjaTrader 8.1.1.7.
Please confirm the enums are in a custom unique namespace and are outside of the script class.
From the help guide:
"Using Custom enum Properties
When creating custom enum properties, it is advised to create the enum outside of your NinjaScript class, and designating it in its own fully qualified namespace. For an example, please see here. When using the enum in code, please use the fully qualified namespace as opposed to using a using directive to shorthand the expression."
https://ninjatrader.com/support/help...assemblies.htm
We demonstrate this in the SampleUniverstalMovingAverage reference sample: https://ninjatrader.com/support/help...ned_parame.htm
Creating a user-defined parameter type (enum) reference sample - https://ninjatrader.com/support/help...ned_parame.htm
If there are multiple files accessing the same enum, I also suggest putting the entire namespace for the enums in a separate file (that's exported separately and then referenced).
To confirm, if you do not select 'Protect compiled assembly' when exporting the script, does the import work as expected?
I look forward to assisting further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
NinjaTrader_BrandonH Please read all posts carefully before you even reply. There was never any mention of an enum being used.
- Likes 2
Comment
-
Hi Brandon,
.
I went down the enum rabbit hole with Chelsea B on Friday thinking that might be the issue until I proved the issue remained while testing the SampleUniverstalMovingAverage reference sample. The unprotected assembly exported from 8.1.2.0 imported fine in 8.1.2.0 while the Agile.Net protected assembly did not.Last edited by whitmark; 10-30-2023, 03:33 AM.
Comment
-
Hello sidlercom80,
Thanks for your notes.
The behavior has been reported to the Development team and they will be investigating this matter further.
As soon as I hear back from the Development team on this reported behavior I will update this forum thread with their findings.
Thanks for your patience.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
The other thing that I am seeing, and this may be a bit of a different issue, is that sometimes on 8.1.2.0 the compiler is getting "stuck" and just sits there looping forever as if it's still compiling. When this happens, heartbeat pacing violations start stacking up (more than 10 in 150 seconds is the message) and eventually I have to exit NT and restart it. This does not occur on 8.1.1.7 with identical code.
Edit: To clarify, when I then restart NT it compiles. It just gets stuck sometimes on 8.1.2.0 while on 8.1.1.7 it does not. I think possibly this is happening when the file is changed externally (e.g. Visual Studio saves the changes) while it is compiling. That was not a problem before. It's also possible it would finish eventually and I am giving up too soon, but I am giving it way longer than it required in 8.1.1.7 before I give up.
Edit 2: P.S. the cursor in Script Editor is invisible in dark mode.
Edit 3: And while we're on the subject of the editor, it outputs all sorts of junk to the trace now:
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorIdentifierForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Required resource key 'brushOrderWorking' is missing.
2023-10-30 06:32:35:448 Required resource key 'brushOrderAccepted' is missing.
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorCompilerErrorForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorIndentationLineForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorKeywordForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorBackground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorStringForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorCollapsibleRegionBackground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Required resource key 'brushOrderPartFilled' is missing.
2023-10-30 06:32:35:448 Required resource key 'brushOrderInitialized' is missing.
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorCommentForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorLineNumbersBackground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Required resource key 'NinjaScriptEditorFontSelectionBrush' is missing.
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorLineNumbersForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorSyntaxErrorForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorNumberForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptOutputSearchHighlight' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Invalid type for resource key 'NinjaScriptEditorPlainTextForeground' : Expected 'System.Windows.Media.Color'; Found 'System.Windows.Media.SolidColorBrush'
2023-10-30 06:32:35:448 Required resource key 'brushBidPriceAlternateForeground' is missing.
2023-10-30 06:32:35:448 Required resource key 'immutableBrushBidPriceAlternateForeground' is missing.
2023-10-30 06:32:35:448 Required resource key 'immutableBrushAskPriceAlternateForeground' is missing.
2023-10-30 06:32:35:448 Required resource key 'brushAskPriceAlternateForeground' is missing.
Last edited by QuantKey_Bruce; 10-30-2023, 05:27 PM.
- Likes 2
Comment
-
QuantKey_Bruce said:
I have had similar problems in the past. They were caused by my having created a customised Skin, albeit based on a standard Skin. The reason for the errors was that the new standard Skin had been updated and the new code was aligned with the new Skin, and that meant conflicts if the "old" Skin was loaded. The solution was to take a copy of the new Skin and apply my customisations to it and use that updated Skin going forward.Edit 3: And while we're on the subject of the editor, it outputs all sorts of junk to the trace now: ... ...
I did the same with 8.1.2.0, and I noticed changes in the Blueprint file that look very much like what you're seeing there.
It would be good if there were a merge procedure that could be applied to updated customised Skins ... but it's not high on my development priority list!
Hope that helps.
Thanks.
- Likes 1
Comment
-
jeronymite That could well be. Thanks for the feedback on this one. I have since rolled back because of the protected assembly issue on all but one test machine until NT or SecureTeam advises how to proceed on that one. I'll sort this out there.
Comment
-
Hello sidlercom80, ,
Thanks for your patience.
Our Development team is requesting some more information so that they may investigate this matter further.
Do you have custom AddOns imported on your platform?
Please create a clean environment by following the steps below and test to see if the behavior persists.
Creating a clean environment can be done by following the steps below:- Close NinjaTrader 8, and rename the "NinjaTrader 8" folder in My Documents to something like: "NinjaTrader 8 OLD"
- Uninstall NinjaTrader from the Windows Control Panel and reinstall using the installer from account.ninjatrader.com
- Add the required indicators and test the template.
For example, Close NinjaTrader and rename the new "NinjaTrader 8" folder to "NinjaTrader 8 NEW" and the "NinjaTrader 8 OLD" folder to "NinjaTrader 8." Then restart the platform. Simply put: NinjaTrader 8 will always load the "NinjaTrader 8" folder in My Documents.
After testing in a clean environment, could you please write in to support[at]ninjatrader[dot]com to send us a copy of your Config.xml file and your Log and Trace files so they may look into this further. In the subject of your email include "Attn: BrandonH" and in the body of your email include a link to this forum thread.
Follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.- Open your NinjaTrader folder under, "Documents" (sometimes called, "My Documents")
- Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
- Send the 2 compressed folders as attachments to this email.
- Once complete, you can delete these compressed folders.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
Hello QuantKey_Bruce,
Thanks for your notes.
Yes, the Development team is currently investigating this reported behavior.
Once I hear back from them after they have finished investigating this matter I will update this forum thread with their findings.
That said, does this only occur on the first compile after upgrading to 8.1.2.0?
Do you have custom AddOns on your platform?
Please create a clean environment by following the steps below and test to see if the behavior persists.
Creating a clean environment can be done by following the steps below:- Close NinjaTrader 8, and rename the "NinjaTrader 8" folder in My Documents to something like: "NinjaTrader 8 OLD"
- Uninstall NinjaTrader from the Windows Control Panel and reinstall using the installer from account.ninjatrader.com
- Add the required indicators and test the template.
For example, Close NinjaTrader and rename the new "NinjaTrader 8" folder to "NinjaTrader 8 NEW" and the "NinjaTrader 8 OLD" folder to "NinjaTrader 8." Then restart the platform. Simply put: NinjaTrader 8 will always load the "NinjaTrader 8" folder in My Documents.
After testing in a clean environment, could you please write in to support[at]ninjatrader[dot]com to send us a copy of your Config.xml file and your Log and Trace files so they may look into this further. In the subject of your email include "Attn: BrandonH" and in the body of your email include a link to this forum thread.
Follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.- Open your NinjaTrader folder under, "Documents" (sometimes called, "My Documents")
- Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
- Send the 2 compressed folders as attachments to this email.
- Once complete, you can delete these compressed folders.
Last edited by NinjaTrader_BrandonH; 11-05-2023, 04:45 PM.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
I have neither the time nor the desire to be the tester for you. Test this yourself before releasing such an important update!!! It's unbelievable what NT keeps doing.Originally posted by NinjaTrader_BrandonH View PostHello sidlercom80, ,
Thanks for your patience.
Our Development team is requesting some more information so that they may investigate this matter further.
Do you have custom AddOns imported on your platform?
Please create a clean environment by following the steps below and test to see if the behavior persists.
Creating a clean environment can be done by following the steps below:- Close NinjaTrader 8, and rename the "NinjaTrader 8" folder in My Documents to something like: "NinjaTrader 8 OLD"
- Uninstall NinjaTrader from the Windows Control Panel and reinstall using the installer from account.ninjatrader.com
- Add the required indicators and test the template.
For example, Close NinjaTrader and rename the new "NinjaTrader 8" folder to "NinjaTrader 8 NEW" and the "NinjaTrader 8 OLD" folder to "NinjaTrader 8." Then restart the platform. Simply put: NinjaTrader 8 will always load the "NinjaTrader 8" folder in My Documents.​
After testing in a clean environment, could you please write in to support[at]ninjatrader[dot]com to send us a copy of your Config.xml file and your Log and Trace files so they may look into this further. In the subject of your email include "Attn: BrandonH" and in the body of your email include a link to this forum thread.
Follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.- Open your NinjaTrader folder under, "Documents" (sometimes called, "My Documents")
- Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
- Send the 2 compressed folders as attachments to this email.
- Once complete, you can delete these compressed folders.
- Likes 2
Comment
-
Hello sidlercom80,
Thanks for your notes.
Our development has received info from the Agile team that the version necessary to work with the C# roslyn update is 6.9.2.0.
Further, once they are done testing and OK it, the Agile team will make it available for users to download at their website<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
-
I have heard from SecureTeam as well and there is definitely a new build required. I'm going to be testing it here as well and can advise after I've put it through its paces. So, everyone is on the same page, I think, that of course, there is an issue here and we don't need to do all that installing and uninstalling etc. because it's clear there is an acknowledged problem and SecureTeam has already prepared a proposed remedy - now it's just a matter of verifying that it does what it is supposed to do then it can be released more broadly.
Comment
-
Hello QuantKey_Bruce,
Thanks for your notes.
In regard to "the compiler is getting "stuck" and just sits there looping forever as if it's still compiling" the Development team has requested more information so they may look into this behavior.
Do you have multiple NinjaScript Editor windows open when this behavior occurs?
Does this behavior only occur on the first compile after upgrading to 8.1.2.0?
Could you please send write in to support[at]ninjatrader[dot]com to send us your workspace file so I can share it with the Development team. In the subject of the email include "Attn: BrandonH" and in the body of the email include a link to this forum thread.
Workspace files could be found in the Documents\NinjaTrader 8\workspaces folder.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
629 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
564 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment