Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / February 2005

Tip: Looking for answers? Try searching our database.

ILGenerator Question...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R@v3n - 16 Feb 2005 13:41 GMT
Is there an easy way to call a method such as Console.Read()  using
ILGenerator.Emit? I can't quite understand how to call a method and when I
tried to use a string, the IL code generated was:
Call        "void [mscorlib]System.Console.Read( )"
Is there any way by which to remove the quotes surrounding it? How do I
actually initiate a Call properly?
"Ed Dore [MSFT]" - 16 Feb 2005 21:57 GMT
Can you elaborate a bit? I'm not quite sure I understand what you are
looking for.

The ILGenerator.Emit amd ILGenerator.EmitCall functions will emit opcodes
into a dynamically generated assembly, but there isn't really a way (short
of disassembling it) to retrieve the actual IL.

Just a few weeks ago I was looking to see if there was an easy way to use
the Reflection.Emit classes to generate textual IL, but there doesn't
appear to be. I did run across some work done by John Gough (of "Compiling
for the .NET Common Language Runtime (CLR) fame, and Diane Corney
consisting of a C# library that would emit textual IL called PEAPI. But I
cannot locate it outside of the Mono open source project out on
http://www.mono-project.com/using/relnotes/1.0-features.html.

Joel Pobar's CLR weblog has some interesting info on the unmaged metadata
reader/writer API's at

     http://blogs.msdn.com/joelpob/archive/2004/09/22.aspx

He's also got an entry on a generating a simple hello world app via
Reflection.Emit at:

     http://blogs.msdn.com/joelpob/archive/2004/01/21/61411.aspx

I also ran across this interesting entry in Mike Stall's block on how to go
about debugging dynamically generated code (via Reflection.Emit), that I
thought was pretty interesting too.

  http://blogs.msdn.com/jmstall/archive/2005/02/03/366429.aspx
     

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.