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!
See more
See less

Partner 728x90

Collapse

Duplicate 'CLSCompliant' attribute

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

    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.

    #2
    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

    Comment


      #3
      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


        #4
        imported post

        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.

        Comment


          #5
          imported post

          When you click on the error, what the problem file is loaded into the editor, can you tell me which file is loaded?

          Ray
          RayNinjaTrader Customer Service

          Comment


            #6
            imported post

            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).

            Comment


              #7
              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


                #8
                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


                  #9
                  imported post

                  The file name at the top is Indicator - Aroon. (but it now compiles as stated in my other message).

                  Comment


                    #10
                    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


                      #11
                      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


                        #12
                        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 CortexZenUSA, Today, 12:53 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post CortexZenUSA  
                        Started by CortexZenUSA, Today, 12:46 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post CortexZenUSA  
                        Started by usazencortex, Today, 12:43 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post usazencortex  
                        Started by sidlercom80, 10-28-2023, 08:49 AM
                        168 responses
                        2,266 views
                        0 likes
                        Last Post sidlercom80  
                        Started by Barry Milan, Yesterday, 10:35 PM
                        3 responses
                        13 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Working...
                        X