Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Another "namespace '...' already contains a definition for '...' "

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

    Another "namespace '...' already contains a definition for '...' "

    Hello.

    I trying to import strategy that use 10+ indicators, including 2 well-know Lizard's indicators amaZerolagTEMA and amaZerolagHATEMA

    Importing process ended with error messages:

    Error compiling import assembly: c:\Users\username\Documents\NinjaTrader 8\tmp\Import\Files\bin\Custom\Indicators\amaZerola gTEMA.cs(54,15) : error CS0101: The namespace 'NinjaTrader.NinjaScript.Indicators.LizardIndicato rs' already contains a definition for 'amaZerolagTEMA'

    Error compiling import assembly: c:\Users\username\Documents\NinjaTrader 8\tmp\Import\Files\bin\Custom\Indicators\amaZerola gHATEMA.cs(54,15) : error CS0101: The namespace 'NinjaTrader.NinjaScript.Indicators.LizardIndicato rs' already contains a definition for 'amaZerolagHATEMA'


    All other indicators are exist in my system too, but all of them were replaced with no errors (including built-in indicators).

    One only difference I see between LizardIndicators and others - LizardIndicators have their own folder (namespace):
    PHP Code:
    NinjaTrader.NinjaScript.Indicators.LizardIndicators 
    This problem repeats continuously for my with different add-ons packs.

    So, want to ask: is there any safe way to export or to import, or to change something in code to get importing without errors?

    I see now only 2 ways for my custom addon packs:
    1. Do not use folder (sub-namespaces) (ugly way).
    2. To create copies of all used indicators and to put all of them in separate folder.
      This not let to avoid errors, but can help to import manually.
      And this way will not work for dll import.


    May be, I miss something?
    I searched forum and manual and didn't find solution.
    Last edited by fx.practic; 08-06-2018, 05:47 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    The message you're receiving occurs when you attempt to import an assembly that contains indicators that you already have in another assembly or that they have imported and are source files.

    Are you importing assemblies or exporting assemblies? Could you attach the zip files for testing?

    Comment


      #3
      I loaded proprietary (sorry, can't share it) strategy, that use a lot of different indicators.
      Most of these indicators were in my file system before; all they are as *.cs files.

      Imported strategy, and all indicators it use, are *.cs files too.

      You can see 2 folders on screenshot: LizardIndicators folder and Indicators folder of *.zip file I tried to import.
      Attached Files
      Last edited by fx.practic; 08-06-2018, 08:43 AM.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello fx.practic,

        Thank you for your response.

        You need to be placing those files in a folder like they are seen in the NinjaScript Editor. This is why manually moving/importing/exporting files is not recommended.

        In your .zip you wish to import you need to create a folder that matches the additional namespace for those indicators. So "LizardIndicators" needs to be a folder in "Indicators" in your .zip file.

        You can get around this by exporting through the NinjaTrader Platform rather than manually moving files around.

        Please let me know if you have any questions.

        Comment


          #5
          Thank You.

          I tried to export all this assembly and found Indicators\LizardIndicators\ folder inside.

          Now, I will try to find out how was performed export procedure on strategy owners's side.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Results of investigation.

            Indicators were downloaded at futures.io.

            Some of them were in *.zip, some were in *.cs.

            *.zip-files were imported throw ControlCenter -> Tools -> Import

            *.cs files were copied just in Indicators folder.

            So, after export I got what I got - no folders, flat structure.

            Thanks for help once more.
            Last edited by fx.practic; 08-06-2018, 01:59 PM.
            fx.practic
            NinjaTrader Ecosystem Vendor - fx.practic

            Comment


              #7
              Understood, thank you for your update.

              If you have any further questions please let me know.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by benmarkal, Yesterday, 12:52 PM
              3 responses
              22 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by helpwanted, Today, 03:06 AM
              1 response
              16 views
              0 likes
              Last Post sarafuenonly123  
              Started by Brevo, Today, 01:45 AM
              0 responses
              11 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by aussugardefender, Today, 01:07 AM
              0 responses
              6 views
              0 likes
              Last Post aussugardefender  
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              244 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Working...
              X