PDA

View Full Version : Duplicate 'CLSCompliant' attribute


SuzyG
12-05-2006, 09:33 AM
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.

NinjaTrader_Ray
12-05-2006, 09:47 AM
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

NinjaTrader_Ray
12-05-2006, 09:50 AM
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")]

public int Period

{

get { return period; }

set { period = Math.Max(1, value); }

}

SuzyG
12-05-2006, 09:51 AM
Yes, it is at the bottom while trying to compile. I have removed all of my custom indicator *.cs files; deleted the NinjaTrader.Custom.dll from bin\custom. I cannot even compile a built in indicator without getting the error.

NinjaTrader_Ray
12-05-2006, 09:56 AM
When you click on the error, what the problem file is loaded into the editor, can you tell me which file is loaded?

Ray

SuzyG
12-05-2006, 10:00 AM
I have tried a handful; @ROC.cs, @RSI.cs, @Aroon.cs, and my own (which I removed from the directory prior to deleting the NT dll).

NinjaTrader_Ray
12-05-2006, 11:04 AM
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

SuzyG
12-05-2006, 11:22 AM
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?

SuzyG
12-05-2006, 11:25 AM
The file name at the top is Indicator - Aroon. (but it now compiles as stated in my other message).

SuzyG
12-05-2006, 11:42 AM
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?

NinjaTrader_Dierk
12-05-2006, 05:44 PM
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.

SuzyG
12-06-2006, 04:59 PM
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.