Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Duplicate 'CLSCompliant' attribute
Collapse
X
-
Duplicate 'CLSCompliant' attribute
When creating custom indicators, I get this error: Duplicate 'CLSCompliant' attribute. I have searched it on the internet, but don't get a clear definition or resolution. It must be something with names, but what? Thank you in advance.Tags: None
-
imported post
Does this error come up at the bottom of the NinjaScript Editor when trying to compile? If yes, this is a new one to me. I tried to reproduce this error and could not in an attempt to determine what causes it.
I will forward to development for some clarification on what may be causing it.
Ray
RayNinjaTrader Customer Service
-
imported post
I think I may have it.
Somewhere in your code you must have a duplicate attribute defined. Look at the sample code below, you will notice that there is a duplicate [Gui.Design.DisplayNameAttribute.....]. Ifyou double click on the error in the editor, it should take you to the trouble area. If I remove this duplicate, it will then compile.
Ray
[Description("")]
[Category("Parameters")]
[Gui.Design.DisplayNameAttribute("The period")]
[Gui.Design.DisplayNameAttribute("The period")]
publicint Period
{
get { return period; }
set { period = Math.Max(1, value); }
}
RayNinjaTrader Customer Service
Comment
-
imported post
Please try this -
- Close all NinjaScript Editor windows
- Open @Arroon indicator
- Compile
- Double click on the error at the bottom of the NinjaScript Editor window
- Please tell me what the top (caption bar) of the NinjaScript Editor says, should say something like "Indicatr - XXXXX" where XXXX is the name of the problem indicator
Thanks
Ray
RayNinjaTrader Customer Service
Comment
-
imported post
I found a solution of sorts:
I just shut down all the charts I had open. They were unable to initialize indicators that I usually run, a custom .dll from a vendor in the bin\custom directory. I deleted NinjaTrader.Custom.dll again and it was rebuilt when I started NinjaTrader 5. Now, I opened any built in indicator and compiled without the error. I opened my indicators (just the tutorial examples) and can now compile them.
Apparently, whatever is in the .dll from a vendor conflicts with others. I will notify them. Do you have any ideas? In AssemblyInfo.cs there is code about CLSCompliant.
I want to be able to keep their indicators and also make my own. Can I have numerous installations of Ninja Trader to keep one vanilla?
Comment
-
imported post
In response to looking for duplicate lines of code: when I couldn't compile, I renamed everything I could. You are probably correct, but since I do not have the source code of the .dll from a vendor, it was hit or miss (or should I say all misses).
I notice there is a separate source file for each indicator and another called @BuiltInIndicator.cs that seems to have all of them in there. Does it have something to do with this? Should all indicators be in one file? If so, how can I run it with my vendor's .dll?
Comment
-
imported post
To run a analysis on this issue it is mandatory to start with a clear defined setup.
You the need to:
- save any custom indicator and vendor DLL to a directory ouside (!!) of <NT-install>
- uninstall NT
- manually delete <NT-install>\bin
- reinstall NT
Now:
- I take it you have a pre-compiled vendor DLL: copy this DLL to <install>\bin\Custom
- start NT
- pull up a standard indicator (e.g. Aaron) in NinjaScript editor and compile. Should work no problem
Lastly:
- now copy your custom indicator file by file into <install>\bin\Custom\Indicator and try to compile after every (!!) file you copied
- in case the issue re-appears, then the last file copied causes the error
Please let us know which step fails.
Comment
-
imported post
I did the steps you suggested in that order and now no longer get any compile errors at all whencompiling exact files that failed before (I used Ninja Trader 5).My vendor's .dll works fine too. I also created a new indicator and it compiled fine. Interesting. :shock:
I will let you know if it arises again and try to keep track of what changes. Thank you for helping.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
5 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
8 responses
61 views
0 likes
|
Last Post Yesterday, 10:45 AM | ||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
4 responses
3,289 views
1 like
|
Last Post
by jgualdronc
Today, 10:02 AM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by halgo_boulder, 04-20-2024, 08:44 AM
|
2 responses
24 views
0 likes
|
Last Post Today, 09:41 AM |
Comment