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

  • SEARCH
  • Home
  • 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 1068439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:17:18+00:00 2026-05-16T20:17:18+00:00

I am learning .NET/C# and because I almost always want to find out how

  • 0

I am learning .NET/C# and because I almost always want to find out how managed object represent in real memory, I am wondering if there is any programmatic method to get these information, including object memory address, size in byte, memory layout and so on?

I know that .NET discourage it and hide information as internal implementation detail. But I am really curious about it for debugging and learning purpose.

  • 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-16T20:17:18+00:00Added an answer on May 16, 2026 at 8:17 pm

    There are 2 compiled versions of the code that is produced the C# compiler:

    • First, it is compiled into Common Intermediary Language (CIL). You can look at this by using the ildasm command in a Visual Studio Command Prompt or by using a (better) tool like Redgate’s .NET Reflector
    • It is then compiled from CIL to native machine code (by the Just In Time Compiler) and run. You can view this code by going Debug > Windows > Disassembly in Visual Studio.

    But you are interested in the memory representation of the native types. This may be difficult and hard to grasp, but if you feel like you’re up to it you can use WinDbg and SOS.dll to debug Managed Code in a native way. I would look at this list of links to get you started. Just google “SOS.dll” for more information.

    I don’t think you will be able to (easily) do this programatically at all from the CLR. Maybe (big maybe) if you used NGEN to compile your assemblies ahead-of-time then use some sneaky C or C++ you might be able to do this, but it would be extremely hard (this is out of my knowledge zone, someone who works on the JIT team might be able to help you)

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

Sidebar

Related Questions

I have been learning VB.NET since the summer and I was wondering if it
I'm interested in learning about parallel programming in C#.NET (not like everything there is
I am currently learning ASP.NET, and I have trouble figuring out how ASP.NET MVC
I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and
I am learning ASP.NET MVC now a days and I have found that most
I am learning ASP.NET and would like to know what are the must have
I am just learning ASP.NET c# and trying to incorporate best practices into my
I'm learning asp.net mvc and found something interesting: It seems that I can't explicitly
I am learning ADO.NET entity framework. This is my first example. The datagrid seems
I am learning ASP.Net. I have a dynamically created ImageButton that I would like

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.