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

packing for commercial distribution with custom assembly

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

    packing for commercial distribution with custom assembly

    hi - I created an indicator that uses an external assembly of mine.
    While developing the indicator, I added reference to the assembly and compiled and all is working well.

    I am now packing and following the instructions in the help section "Adding custom assemblies or Native Dll's"

    Now when I import, I get an error. I checked the trace and I can see that there is a message that NT can't find a namespace. This namespace is defined in the custom assembly.

    Any ideas?

    #2
    Hello,

    This could be the way you are calling the custom assembly from the indicator.

    Instead of using a using statement, you can try calling each method or other by its fullname or:

    namespace.object

    If this does not work, you can try to manually import the assembly and do a compile to see all of the errors generated which would give a much better idea of what is happening.

    If the first option does not correct this please send an email to platform support @ ninjatrader.com in reference to ticket 1314873 and I can help you manually install and read the errors listed to determine what happened.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by onnb1 View Post
      hi - I created an indicator that uses an external assembly of mine.
      While developing the indicator, I added reference to the assembly and compiled and all is working well.

      I am now packing and following the instructions in the help section "Adding custom assemblies or Native Dll's"

      Now when I import, I get an error. I checked the trace and I can see that there is a message that NT can't find a namespace. This namespace is defined in the custom assembly.

      Any ideas?
      ref: http://www.ninjatrader.com/support/f...33&postcount=1

      You may want to read the entire thread, or at the very least the post to which I was responding.

      Comment


        #4
        hi - thanks for responding and the link koganam - I read through it.

        In my indicator I am using the fully qualified name (I don't have a using statement for my namespace). So all my references look like namespace.object in my NT indicator code.

        When you create an archive like this, the auto generated "Factory" code goes in the cs file - lets call it "wizard.cs" for now. When I import the archive and look in the trace, I can see that the error is coming from wizrad.cs. I do indeed have one input parameter (property) in there that uses an enum from my custom namespaces. That said, in wizard.cs the param is also fully qualified as namespace.object.

        From your description you are referring to the case where one has a using statement in the indicator file, yes?
        Last edited by onnb1; 05-11-2015, 01:54 PM.

        Comment


          #5
          Instead of using a using statement, you can try calling each method or other by its fullname or:


          namespace.object

          If this does not work, you can try to manually import the assembly and do a compile to see all of the errors generated which would give a much better idea of what is happening.
          hi, see my reply to koganam regarding the naming which is indeed namespace.object.

          Regarding your second suggestion to import manually - do you mean

          1. open any script in the editor
          2. add a reference to my custom assembly
          3. compile

          yes?

          Comment


            #6
            Originally posted by onnb1 View Post
            hi - thanks for responding and the link koganam - I read through it.

            In my indicator I am using the fully qualified name (I don't have a using statement for my namespace). So all my references look like namespace.object in my NT indicator code.

            When you create an archive like this, the auto generated "Factory" code goes in the cs file - lets call it "wizard.cs" for now. When I import the archive and look in the trace, I can see that the error is coming from wizrad.cs. I do indeed have one input parameter (property) in there that uses an enum from my custom namespaces. That said, in wizard.cs the param is also fully qualified as namespace.object.

            From your description you are referring to the case where one has a using statement in the indicator file, yes?
            My response in the referenced thread does apply to when the namespace is referenced by a "using" statement.

            However, what you are describing may mean that your reference is not using the FQPN, but just the tail end of it. If you want to use a FQPN, determine its totality, and use the totality.
            Last edited by koganam; 07-07-2016, 08:37 PM. Reason: Corrected spelling.

            Comment


              #7
              Originally posted by koganam View Post
              My response in the referenced thread does apply to when the namespace id referenced by a "using" statement.

              However, what you are describing may mean that your reference is not using the FQPN, but just the tail end of it. If you want to use a FQPN, determine its totality, and use the totality.

              Not sure what you mean by FQPN

              For what its worth maybe this would help: my custom assembly has a top level namespace "Foo" and I have a public enum named Bar first level inside Foo.

              something like this:
              Code:
              namespace Foo
              {
                   public enum Bar
                   {
                       Top,
                       Bottom
                   }
              }
              So in the indicator file I have Foo.Bar as a property type. NT is saying on import that it doesn't recognize Foo.

              Comment


                #8
                Originally posted by onnb1 View Post
                Not sure what you mean by FQPN

                For what its worth maybe this would help: my custom assembly has a top level namespace "Foo" and I have a public enum named Bar first level inside Foo.

                something like this:
                Code:
                namespace Foo
                {
                     public enum Bar
                     {
                         Top,
                         Bottom
                     }
                }
                So in the indicator file I have Foo.Bar as a property type. NT is saying on import that it doesn't recognize Foo.
                Show the skeleton of your Property declaration, if you please?

                Comment


                  #9
                  Originally posted by koganam View Post
                  Show the skeleton of your Property declaration, if you please?

                  Code:
                  [GridCategory("Parameters")]
                  public  Foo.Bar Location
                  {
                      get { return location; }
                      set { location = value; }
                  }

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by agclub, Yesterday, 08:57 PM
                  2 responses
                  16 views
                  0 likes
                  Last Post agclub
                  by agclub
                   
                  Started by cre8able, 04-17-2024, 04:16 PM
                  6 responses
                  55 views
                  0 likes
                  Last Post cre8able  
                  Started by Mindset, 05-06-2023, 09:03 PM
                  13 responses
                  293 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by kaywai, 09-01-2023, 08:44 PM
                  4 responses
                  600 views
                  0 likes
                  Last Post joselube001  
                  Started by dpolyakov, 03-29-2024, 11:30 AM
                  3 responses
                  135 views
                  2 likes
                  Last Post sonia0101  
                  Working...
                  X