Groups | Blog | Home
all groups > dotnet framework > april 2007 >

dotnet framework : MethodBuilder.CreateMethodBody



shark
4/20/2007 4:27:25 PM
Hi,

MethodBuilder.CreateMethodBody creates the body of the method using a
supplied byte array of Microsoft intermediate language (MSIL) instructions.
Is there any way to create and compile method at runtime created from byte[]
of c# code?
i.e.
public int sum(int a, int b)
{
return a+b;
}

How to create such method ?

Thx
Mattias Sjögren
4/20/2007 9:16:10 PM
[quoted text, click to view]

If you want to compile C# code you should probably look at using
CodeDom instead.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button