Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 723235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:05:04+00:00 2026-05-14T06:05:04+00:00

I have been curious about dynamically create class at runtime in C# and stumbled

  • 0

I have been curious about dynamically create class at runtime in C# and stumbled across this article. http://olondono.blogspot.com/2008/02/creating-code-at-runtime.html I am curious to hear some pros and cons regarding construction of a class at runtime.

Any opinions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:05:05+00:00Added an answer on May 14, 2026 at 6:05 am

    Meta-programming has all the advantages of build-time code-gneneration, but without the additional code step. This is very common in library code, such as ORMs, serializers, some types of AOP, DI/IoC containers, etc.

    • + avoids the need for extra build steps or writing mundane code
    • + such code can handle what actually is the case at runtime, rather than having to handle any uncommon edge-cases or lots of wrappers around wrappers (decorator pattern)
    • + allows codegen in scenarios where the metadata is only known at runtime
    • + runtime IL can have more access to private fields etc, thanks to how DynamicMethod can be associated with a type; fully generated (dll) code would require [InternalsVisibleTo] or similar, which may be impossible
    • – not all systems support runtime code-gen; it is disabled on some server setups, compact framework, iPhone, etc
    • – it is bug ugly to do. Regardless of how you do it, this is not normal code.
    • – it needs a really good understanding of how things actually work under the covers
    • + if forces you to get a really good understanding of how things actually work under the covers

    I’m currently re-writing an existing library to use runtime IL generation; it is very rewarding and I’m happy with it; but it is unlike anything I’ve written before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ever since I started programming this has been something I have been curious about.
I have always been curious about this - why do in C++ I have
I've always been curious about audio conversion software, but I have never seen a
Well I have been thinking about this for a while, ever since I was
I'm curious about the performance enhancements that have been made for FSharpFunc<_> . Is
I have been reading through the C++ FAQ and was curious about the friend
I have been quite curious about how javascript reacts to errors(like ReferenceError, for example).
Something I have been curious about for quite sometime now. How exactly do you
I have been working with the DevExpress Filter TreeList code and am curious about
Just curious about this, I have one server our dev where a ridiculous amount

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.