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

CS0246: The namespace could not be found while exporting of the working indicator.

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

    #16
    Hello AlexMocc,

    NinjaTrader utilizes .NET Framework 4.8

    If you have it working in the platform as source code then you have the correct version and instead need to look at the code you are using. The sample in post #13 would be expected to fail, you are using:

    Code:
    using LicenseSpot.Framework;
    That will fail in an export.


    Please let me know if I may be of further assistance.

    JesseNinjaTrader Customer Service

    Comment


      #17
      "Do you still see the problem when not using the using statement at the top of the file and instead using fully qualified types?"
      yes. The same issue with exporting.
      The indicator works and compile without error.
      "The only other suggestion that I could make here is to make sure you have the dll placed in the Documents\NinjaTrader 8\bin\Custom folder,"
      Yes. It is.

      Any ideas why NT8 cannot export the working indicator?

      Attached Files

      Comment


        #18
        .NET 4.8 is installed

        Comment


          #19
          Hello AlexMocc,
          Any ideas why NT8 cannot export the working indicator?
          No, to assist further here we would need to see the code used in the dll for that type to better understand why that cannot be found during the export. As the dll is a third party item that the source is not available there is not a way to review why that may be failing without being able to get a sample of that code.

          The reference appears to be in the correct location and as long as you are selecting both the indicator and reference during the export that would be all you can do to ensure it can export. The new sample shows you are using the fully qualified type.

          You may want to double check that your external dll does not have any other files required, if it uses other dlls or files that may be part of the problem if they are not being added in the export menu.

          You could also check if that company offers different versions for different versions of .net and try different dll's they offer however that would be out of the scope that I could assist with.


          Please let me know if I may be of further assistance.


          JesseNinjaTrader Customer Service

          Comment


            #20
            Originally posted by AlexMocc View Post
            Hi!
            I am using the custom DLL in my indicator.
            On the chart this indicator is working as expected.
            After updating to the version 8.0.24.2 64-bit the error "error CS0246: The type or namespace name 'LicenseSpot' could not be found (are you missing a using directive or an assembly reference?)" appears when I try to export the assembly either as a source or as a compiled.

            Before updating to the current version everything worked as expected.
            Has the DLL been added as a reference to NinjaTrader?

            Comment


              #21
              This assembly was created some time ago.
              As you can see the source code of the indicator and dll is the same.
              What was changed in NT8 since this assembly was exported?
              The computer is the same.
              This assembly is the clear proof the NT8 has a bug introduced in last updates.
              Last edited by AlexMocc; 05-14-2021, 12:13 PM.

              Comment


                #22
                "Has the DLL been added as a reference to NinjaTrader?"
                Sure. The indicator can work if all references are resolved.
                You may see the picture with all references several messages above.

                Comment


                  #23
                  Hello AlexMocc,

                  Because we don't know what code is being used in the third party assembly we couldn't say what may be affecting the export. We have gone through what we can assist with in regard to NinjaTrader. We would need to know more about what code is used in the assembly to know what may have changed in NT8 that would affect that.

                  As a side note I had to remove your attachment again, please do not attach .dll files to your posts.

                  Please let me know if I may be of further assistance.
                  Last edited by NinjaTrader_Jesse; 05-14-2021, 12:30 PM.
                  JesseNinjaTrader Customer Service

                  Comment


                    #24
                    "Because we don't know what code is being used in the third party assembly we couldn't say what may be affecting the export."
                    The dll was NOT changes since the assbely was exported.
                    Some version of the NT* WAS able to export this file without any issues.
                    Then...
                    You have updated NT8. The new version of the NT8 is not able to create this file.
                    The NT8 is the ONLY thing changed in this set. It means the reason is in the NT8. It is easy. IMHO.

                    "...we couldn't say what may be affecting the export."

                    Really? You can not check what is changed in YOUR code?

                    Ask your programmers what is affected the export. You see the version of NT8 used to create this zip.

                    Comment


                      #25
                      Hello AlexMocc,

                      The dll you linked to does not appear to be an open source project so we have no insight on what may be causing the export problem in contrast to whats contained in that dll. From a support standpoint we have very limited ability to help with third party dlls at all. In some situations we can sometimes help with opensource projects because we can look into the code being used. In this case you are using something that I cannot see the code for so it would be unknown what may be affecting that use case.

                      Really? You can not check what is changed in YOUR code?
                      No I cannot. What I can do is report problems to development but we don't have the required information for me to do that. We would need details on what code the external library uses so we can form a sample of the issue. Providing a dll as part of the issue would not be helpful in tracking down an issue.

                      Ask your programmers what is affected the export. You see the version of NT8 used to create this zip.
                      We would need a sample that reproduces the problem and the source code of the DLL for me to do that, I otherwise don't have enough details to form a report to send to development.

                      While you can use third party libraries they are not guaranteed to work in NinjaTrader, what you linked to is made for general C# applications and not specifically NinjaTrader. While that may work it may also not work as the platform gets updated. I could only suggest looking for an open source project which accomplishes the tasks you needed that library for. In case of problems that can likely be addressed by reviewing the code of that library.

                      You can try checking if the project you are currently using has any updated or alternate dll files as well. I have otherwise gone through what I can assist with in making sure you are using the fully qualified name, the dll is in the correct folder and you are correctly adding the reference during the export. Beyond that we would need details on the code in that library to continue further.


                      Please let me know if I may be of further assistance.

                      JesseNinjaTrader Customer Service

                      Comment


                        #26
                        Originally posted by AlexMocc View Post
                        This assembly is the clear proof the NT8 has a bug introduced in last updates.
                        So far, it is clear proof of nothing.

                        But I know you are frustrated, that part is very clear.

                        The possibility exists that NinjaTrader code which previously did the wrong/incomplete thing
                        was updated and is now doing the same thing more correctly.

                        Things like this happen, and the "pedantic fix" (even if it was not done explicitly, or even if it
                        was intentional) sometimes these changes make the code stricter than the previous release.

                        Whether this new 'strictness' you have found in the export process is an unfortunate side
                        effect or is actually by design, the 'strictness' itself does not mean, from a technical point
                        of view, it is an engineering defect.

                        My point is:
                        It's always possible that code changes in a high-level product (usually as part of a fix, or
                        an upgrade) can then reveal (previously masked) defects in downstream products.

                        I'm not trying to be difficult. In fact, I'd like to help you figure this out.
                        If you're inclined, contact me via private message.

                        Comment


                          #27
                          As you see the compiler does not see the error in the line (129. 16)
                          The VS does not see the error in this line too.

                          It means the message about the error is not relevant at least.
                          Can you explain what the message means?
                          Attached Files
                          Last edited by AlexMocc; 05-14-2021, 01:28 PM.

                          Comment


                            #28
                            the same situation with the trivial code.
                            Both indicators are working on the chart.


                            "The possibility exists that NinjaTrader code which previously did the wrong/incomplete thing
                            was updated and is now doing the same thing more correctly."
                            More correctly.... Witch part is working "more correctly"?

                            I see the introduced inconsistency between different parts of the NT8. They usually call it the bug.
                            The script editor, visual studio and charting system all are working as it is described in the documentation.

                            The export module is working "more correctly" and can not export the indicator witch is working in all another parts of the system as expected.

                            It is a really nice attempt to make the user more stupid than they are usually are.
                            Try to tale a look on the mirror, my friend,

                            The NT8 has a bug ether in the script editor and chart (and VS ) either in the export module. It is up to you.
                            And you do not want to confirm it and help to solve.
                            Attached Files

                            Comment


                              #29
                              "I'm not trying to be difficult. In fact, I'd like to help you figure this out.
                              If you're inclined, contact me via private message."

                              I see no any reasons to discuss this situation in the private mail.
                              And less important ... I do not know how to contact you in the private email.

                              Comment


                                #30
                                I'm saying it's not clear in who's code the bug is located.
                                It may or may not be in NinjaTrader code.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by fx.practic, 10-15-2013, 12:53 AM
                                5 responses
                                5,403 views
                                0 likes
                                Last Post Bidder
                                by Bidder
                                 
                                Started by Shai Samuel, 07-02-2022, 02:46 PM
                                4 responses
                                94 views
                                0 likes
                                Last Post Bidder
                                by Bidder
                                 
                                Started by DJ888, Yesterday, 10:57 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by MacDad, 02-25-2024, 11:48 PM
                                7 responses
                                158 views
                                0 likes
                                Last Post loganjarosz123  
                                Started by Belfortbucks, Yesterday, 09:29 PM
                                0 responses
                                8 views
                                0 likes
                                Last Post Belfortbucks  
                                Working...
                                X