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 / .NET Framework / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Emitting entire class from source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
thomas.greenleaf@gmail.com - 14 Jun 2007 22:11 GMT
Some time ago I wrote a simple reflection.emit example where I emitted
an entire assembly based on source code. Now I forgot exactly how and
all examples online deal only with defining a class through reflection
methods, defining a method and then finally emitting IL for that
specific method.

What I had then would take a string such as "namespace someName{class
someTest{public int test(int a, int b){return a+b;}}}" and then
emitting a class which I could use through reflection.

I would like to do that again, but I have been unable to find examples
of doing so.
Jon Skeet [C# MVP] - 14 Jun 2007 22:38 GMT
> Some time ago I wrote a simple reflection.emit example where I emitted
> an entire assembly based on source code. Now I forgot exactly how and
[quoted text clipped - 8 lines]
> I would like to do that again, but I have been unable to find examples
> of doing so.

CSharpCodeProvider? That's what I use for similar purposes.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


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.