Jb
I am fairly sure I am removing the only use of that assembly.
And here is another curiosity.
If instead of doing this
module.AssemblyReferences.Remove(referenceToRemove);
I do this
module.GetTypeReferences();
module.AssemblyReferences.Remove(referenceToRemove);
it works.
On Jan 11, 8:35 pm, Jb Evain <[email protected]> wrote:
> Hi Simon,
>
> On Tue, Jan 11, 2011 at 8:38 AM, Simon Cropp <[email protected]> wrote:
> > The issue seems to be caused by a reference being removed incorrectly????
>
> > I am removing the use of an attribute and then removing the assembly
> > reference for that attribute.
>
> > I am removing the reference like this
>
> You can't just remove the AssemblyNameReference if the assembly
> contains a TypeReference, with a scope to that very
> AssemblyNameReference.
>
> Simply put, you need to make sure nothing references the assembly
> before you remove it.
>
> Jb
--
--
mono-cecil