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

Missing Assembly references that I don't need

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

    Missing Assembly references that I don't need

    Hi,

    I have written an indicator that was comiling fine, it had a couple of external assembly references. I have now imported some other ninja indicators from a friend, and now my own indicator requires .dll's from his indicator to be included with mine, and in the external references text file that is created when I export my indicator, those references are included in that file, as well as my own.


    I removed the references from my indicator (right click in indicator source and go to references and delete) and now I am getting the CS0234 error about missing references but they are referring to assemblies from the indicator I imported from my friend, they are nothing to do with my indicator and I dont need them.

    How can I get it to compile correctly?

    Thanks,

    #2
    dontpanic, thanks for the post - you would need to ask your friend to export you the script without those assembly references set on his setup. Then you should be able to import and run normally as well.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      the assembly references are to his indicator, not mine. there should be NO references in my indicator that refer to his indicator, they are entirely separate.

      The error that i am getting when trying to compile are from a .cs file that is the source to his indicator, it has nothing to do with my indicator. I dont know why my indicator is trying to refer to that source file.

      Comment


        #4
        Correct, as it would be expected - if he exported the compiled file with those references set >> the DLL would expect the same references on your system. That's why he would need to export fresh with only the NT default references set, so it would work as expected on your system that would not have all of his custom references.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          i dont understand, why do the references in his indicator affect my indicator? My indicator compiled fine and exported fine before i imported his indicator. also, my indicator is refering to the source file for HIS indicator, not external references that me makes in his indicator.

          Comment


            #6
            It would not matter. His indicator has been compiled with his references set. If you import that study on your system > it would expect the exact same references then to be present. So he would have to export from a clean setup for you.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Sorry, but this makes no sense. When you say "his references set" are you talking about external references that he makes within his indicator? If so, I dont think thats whats happening.

              The missing assemblies in my indicator are to his actual indicator, not to external references that he makes WITHIN those indicators.

              I can compile my indicator if I put back the references to his indicator, because I have his dll's still installed. The problem is that I want to send MY indicator to another friend, who doesnt have my first friends indicator, so it wont install properly. my second friend cannot install MY indicator unless he also has my first friends indicator. sorry if I sound frustrated but that doesnt make any sense.

              I should theoretically be able to REMOVE my first friends indicator, then compile my own indicator and export it, the put those indicators back. Problem now is when I try to remove an assembly NT says that I have programming errors and no assemblies can be removed until i fix them.

              Comment


                #8
                'I should theoretically be able to REMOVE my first friends indicator, then compile my own indicator and export it, the put those indicators back.'

                That's correct and how I would expect it to work. What you would need to look into first is fixing those compile issues, removing assemblies from your friend, then exporting your script for your other friend and then reimporting the script you removed to be able to generate the export.

                If you would like us to take a remote look at the compile issue, please get in touch with us via Help > Mail to Support from within NT. Thanks.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Ok, this is what I did -

                  added the references to my friends indicator back into my indicator
                  recompiled correctly.
                  uninstalled (removed assemblies) his indicators
                  removed references from MY indicator to HIS indictor
                  recompile now without the need for his indictors and therefore no references

                  So now I have a working compiled and exported indictor that doesnt make reference to his indicator.

                  Problem is now, and this is what I dont get, as soon as I re-install his indicators, and want to make a change to my indicator and recompile, its going to require references to his indicator, right? and so the problem starts all over again.

                  I dont understand why I cant create my own indicator and compile it without references to this other indicator (my friends) that has nothing to do with mine...

                  Comment


                    #10
                    Generally with reference two things are meant here

                    a) a call to a method / value of your friends script
                    b) a reference to the dll installed on your system, usually added via right click in the code > References > add

                    b) would be needed if you installed the script as compiled assembly, so not open source / .cs files.

                    If you export any script then from your system with his protected / compiled DLL installed > the target machine would need those references as well set, otherwise the compile would not work out. This is precisely the reason why we generally recommend developers to export their packages for client machines from a setup with all custom references removed and therefore only the default NT references present.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by dontpanic View Post
                      i dont understand, why do the references in his indicator affect my indicator? My indicator compiled fine and exported fine before i imported his indicator. also, my indicator is refering to the source file for HIS indicator, not external references that me makes in his indicator.
                      NT compiles all indicators into a monolithic gumball, so any assembly references are global. If you do not want his references polluting your installation, then you should remove his indicator completely. That is why I always export my code from a clean machine that I use only for my own development.

                      Comment


                        #12
                        thanks to both of you for your replies and persistence.

                        Koganam, I understand your comment, and I was thinking of doing exactly that, but I just thought it was an extreme solution and there must be a better way. I typically work on my indicators whilst I am trading, during slow market times, but I can do that if required.

                        Bertrand, in response to your reply, I still have a couple of questions.

                        **** a) a call to a method / value of your friends script

                        I dont make any calls to any methods in my friends script.

                        ****b) a reference to the dll installed on your system,

                        I dont make any calls to any of his references, I don't invoke his indicator or make any connection to it.

                        This is the part I don't understand, if you could perhaps explain in more detail? From my SOURCE code point of view, there is absolutely no connection between my indicator and his, there are no common calls or even .dll's that we use in common. My source code compiled and exported sucessfully, UNTIL I installed his indicator. Now my indicator won't compile without using Add->Reference to his indicator .dll.

                        If I do that (add the reference) it will compile, but then when I try to export it it requires his .dll's to be included in the export, otherwise another person cannot import my indicator.

                        So, my question in essence is... in my indicator source code I make no calls to his indicator, or any of his methods, or anything to do with his indicator. Therefore, why do I have to add a reference to his indicator .dll for my code to compile?

                        as you said in your last reply -

                        ***If you export any script then from your system with his protected / compiled DLL installed > the target machine would need those references as well set, otherwise the compile would not work out.

                        My question is WHY does the target machine need those references installed, when my source code does not require them?

                        Thanks again.

                        Comment


                          #13
                          'My source code compiled and exported successfully, UNTIL I installed his indicator. Now my indicator won't compile without using Add->Reference to his indicator .dll.'

                          Correct, that's exactly what we would expect - your friends scripts needs the reference to work and since all (!) files are compiled into one assembly to be used at runtime > your indicator is now compile with your friends as well into the mix. There's no isolated compile happening here, so all scripts would always have to be in a compilable state. There's more flexibility in this area considered for our next major release...
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            Ok, I didnt realise that all the assemblies weren't seperate. I've installed NT on a seperate computer for development only.

                            Thanks.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by RubenCazorla, Today, 09:07 AM
                            2 responses
                            11 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by i019945nj, 12-14-2023, 06:41 AM
                            7 responses
                            81 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by timmbbo, 07-05-2023, 10:21 PM
                            4 responses
                            158 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by tkaboris, Today, 08:01 AM
                            1 response
                            7 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by Lumbeezl, 01-11-2022, 06:50 PM
                            31 responses
                            819 views
                            1 like
                            Last Post NinjaTrader_Adrian  
                            Working...
                            X