Hi,

On Mon, Aug 1, 2011 at 1:53 PM, jasper <[email protected]> wrote:
> Can I inject code into .net assemblies like System.Windows.Forms or
> System.Web? If yes, what should I do to get it working?

You can inject IL code into .net assemblies but you won't be able to
strong sign them back, unless you have Microsoft's private key. Thus
they won't load.

> I tried this
>            AssemblyDefinition assembly =
> AssemblyFactory.GetAssembly(typeof(System.Web.UI.Page).Assembly.Location);
> but it failed.

That's using an old version of Cecil. Please use github.com/jbevain/cecil

If you need to inspect System.Web, you can always do:

var assembly = AssemblyDefinition.ReadAssembly (typeof
(Page).Module.FullyQualifiedName);

Jb

-- 
--
mono-cecil

Reply via email to