Hi Jb,

I am using the Definition of another module. I get this error after I 
delete the original Types. If I keep the original types then it works fine 
as expected.
I tried to add the reference of the original assembly  to new 
assembly before writing the new assembly but still I got the same error.

Is there any other way to achieve the same ?

Thanks,
Dhananjay

On Friday, January 9, 2015 at 1:39:16 AM UTC-7, Jb Evain wrote:
>
> Hi Dhananjay, 
>
> This error means that for the module you're manipulating, you're using 
> directly an instance of a Reference or a Definition for another 
> module. 
>
> For instance, you can't take a TypeDefinition from a module and add it 
> to another module. 
>
> Jb 
>
>
>
> On Fri, Jan 9, 2015 at 8:23 AM, Dhananjay Dhamale <[email protected] 
> <javascript:>> wrote: 
> > Hi, 
> > I am writing an application using mono-cecil to create a new assembly 
> where 
> > all members will be "public" by changing access specifier from "private" 
> to 
> > "public" for all members of an existing assembly. I am changing the name 
> of 
> > all Types to "_NewType" and delete the original type.  It worked all 
> fine 
> > with normal class but it fails where class has nested class. And it 
> gives 
> > exception as - "Member 'Math.InternalClass' is declared in another 
> module 
> > and needs to be imported". 
> > 
> > The source code is as below - 
> > 
> >   internal sealed class InternalClass 
> >     { 
> >         private InternalClass() 
> >         { 
> > 
> >         } 
> > 
> >         private sealed class Singleton 
> >         { 
> >             public InternalClass CreateInstance() 
> >             { 
> >                 //return new InternalClass(); 
> >                 InternalClass a = new InternalClass(); 
> >                 return a; 
> >             } 
> >         } 
> >     } 
> > 
> > Appreciate your help on this. 
> > 
> > Thanks, 
> > Dhananjay 
> > 
> > -- 
> > -- 
> > -- 
> > mono-cecil 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "mono-cecil" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to