Hi, On Tue, Jan 11, 2011 at 11:46 AM, Simon <[email protected]> wrote: > 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.
It means that there's at least one TypeRef row which references the assembly you're trying to remove. So in the second case, you force the creation of the TypeReference, and then you delete the assembly. Probably leaving the assembly with a weird TypeReference somewhere. In the first case, it will crash whenever the lazy loading mechanism will trigger the load of the TypeRef row. Jb -- -- mono-cecil
