Hi,

I'm a Mono.Cecil n00b trying to do some IL rewriting on Silverlight
assemblies, but I seem to be doing something wrong. The "tampered"
assemblies (after rewriting) look OK in ILSpy, except for the
references to .NET framework libraries, which include the
standard .NET v 4.0 (not Silverlight) of system.dll and mscorlib.dll.
I guess I must be doing something wrong when I'm importing types? I
tried to follow the recipe here:
http://stackoverflow.com/questions/9109506/mono-cecil-fails-to-process-a-silverlight-5-assembly
so I use the following code to read the assembly:

var resolver = new DefaultAssemblyResolver();
resolver.AddSearchDirectory(@"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\Silverlight\v4.0");
var assembly = AssemblyDefinition.ReadAssembly(
     assemblyPath,
     new ReaderParameters { AssemblyResolver = resolver });

I still seem to have the same problem, though. How do I best debug
this? How can I spot that I've inserted a faulty reference to the
regular .NET v4 dlls? I'm trying to inspect the
TypeReference.Module.Runtime and TypeDefinition.Module.Runtime of the
various types I use, does that make sense?

Any help would be greatly appreciated.

Kind regards,
Einar

-- 
--
mono-cecil

Reply via email to