Home All Groups Group Topic Archive Search About

MethodBuilder.CreateMethodBody

Author
20 Apr 2007 2:27 PM
shark
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

Author
20 Apr 2007 7:16 PM
Mattias Sjögren
>How to create such method ?

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
Please reply only to the newsgroup.

AddThis Social Bookmark Button