Re: Reflection.Emit usage

Tech-Archive recommends: Fix windows errors by optimizing your registry




Can anybody provide a good example for the Reflectio.Emitl namespace
usage? The problem I'm trying to solve is copying the method body from
existing class to newly created one.

The raw IL byte stream you get with MethodBody.GetILAsByteArray()
contain token values that are only valid within the same executable
module. You can't take those raw tokens and write them to another
method body and expect it to work.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
.