DevLabs > DevLabs Forums > Axum Incubation Project > Error:Cannot explicitly access domain members except via 'parent'
Ask a questionAsk a question
 

AnswerError:Cannot explicitly access domain members except via 'parent'

  • Monday, September 14, 2009 11:29 AMVicky2006 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,
     I am Getting an Error:Cannot explicitly access domain members except via 'parent'
    while accessing the agent abc from different namespace.

Answers

All Replies

  • Tuesday, September 15, 2009 4:02 PMJosh PhillipsMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Vicky,

    Can you please post a code sample?

    Thanks,
    Josh
  • Wednesday, September 16, 2009 4:43 AMVicky2006 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer

    Hi Philips,

    As requested by you i am posting code

    namespace AxumAdderLibrary
    {
     public channel MathOP
        {
            input  int num1;
            input  int num2;
            output int sum;
        }
        public domain Program
        {
            int num=100;
            int s=0;
           
           
         public  agent AdderAgent:channel MathOP
     {
                public AdderAgent()
                {
                   
                    var res=receive(PrimaryChannel::num1)+receive(PrimaryChannel::num2);
                    Console.WriteLine("Resut of Addition:"+res);
                    PrimaryChannel::sum<--res;
                    //Console.WriteLine(num);
                   
                   
                }
               
               
            }
       }
    }

    This one is a library and i am refering this one other Axum Project which looks like below code

    namespace prg2
    {
     
     public domain Program2
        {
           
            agent workerAgent:channel Microsoft.Axum.Application
            {
               
                public workerAgent()
                {
                    Console.WriteLine("Inside Worker Agent::..................................");
                   
      var writerEx=Program.AdderAgent.CreateInNewDomain();//********

                    writerEx::num1<--50;
                    writerEx::num2<--50;
                    var addRes=receive(writerEx::sum);
                                 
                }
            }
                  
        }
    }


    //***** in this line if i refer AdderAgent using namespace i am getting the following error
     
     Ex:AxumAdderLibrary.Program.AdderAgent.CreateInNewDomain();
     
     Error:Cannot explicitly access domain members except via 'parent' 


    and if i declare the library by using Statement using AxumAdderLibrary; then error will not come

     using AxumAdderLibrary;//before the namespace
     
     Ex:Program.AdderAgent.CreateInNewDomain();

    Now i am getting the Error:class 'AxumAdderLibrary.Program.AdderAgent' already contains an entry for '__AsyncRun' 

    Please let me know at may be causing the error
     

  • Wednesday, September 16, 2009 6:29 PMJosh PhillipsMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Vicky,

    This is a bug.  Thank you for pointing it out!

    Josh