Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How Windows knows .Net EXE's?

How Windows knows .Net EXE's?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdotnetjsonperformancetutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ranandbe
    wrote on last edited by
    #1

    Hi folks, How the windows API differenciate Normal EXE'x from the .Net EXE's, for example when you click the .Net exe file then it should be load the CLR into memory and execute the exe otherwise it never load CLR to execute. If any one knows please share with me. Advance Thanks,

    friendly, ranandbe

    P 1 Reply Last reply
    0
    • R ranandbe

      Hi folks, How the windows API differenciate Normal EXE'x from the .Net EXE's, for example when you click the .Net exe file then it should be load the CLR into memory and execute the exe otherwise it never load CLR to execute. If any one knows please share with me. Advance Thanks,

      friendly, ranandbe

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      ranandbe wrote:

      How the windows API differenciate Normal EXE'x from the .Net EXE's, for example when you click the .Net exe file then it should be load the CLR into memory and execute the exe otherwise it never load CLR to execute. If any one knows please share with me.

      A .NET executable contains a special CLR Header, which is only available in .NET executables. The PE (portable executable) header will redirect the OS to this section. It's worthwhile getting to know how the PE format is used and what it does.

      Deja View - the feeling that you've seen this post before.

      R 1 Reply Last reply
      0
      • P Pete OHanlon

        ranandbe wrote:

        How the windows API differenciate Normal EXE'x from the .Net EXE's, for example when you click the .Net exe file then it should be load the CLR into memory and execute the exe otherwise it never load CLR to execute. If any one knows please share with me.

        A .NET executable contains a special CLR Header, which is only available in .NET executables. The PE (portable executable) header will redirect the OS to this section. It's worthwhile getting to know how the PE format is used and what it does.

        Deja View - the feeling that you've seen this post before.

        R Offline
        R Offline
        ranandbe
        wrote on last edited by
        #3

        Thank You. After you say that i go and open the EXE with ILDASM utility. It Shows the following at the program entry point. .method private hidebysig static void Main() cil managed { .entrypoint .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 ) // Code size 26 (0x1a) .maxstack 8 IL_0000: nop IL_0001: call void [System.Windows.Forms]System.Windows.Forms.Application::EnableVisualStyles() IL_0006: nop IL_0007: ldc.i4.0 IL_0008: call void [System.Windows.Forms] ****************************** } // end of method Program::Main What it tells?

        friendly, ranandbe

        C 1 Reply Last reply
        0
        • R ranandbe

          Thank You. After you say that i go and open the EXE with ILDASM utility. It Shows the following at the program entry point. .method private hidebysig static void Main() cil managed { .entrypoint .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 ) // Code size 26 (0x1a) .maxstack 8 IL_0000: nop IL_0001: call void [System.Windows.Forms]System.Windows.Forms.Application::EnableVisualStyles() IL_0006: nop IL_0007: ldc.i4.0 IL_0008: call void [System.Windows.Forms] ****************************** } // end of method Program::Main What it tells?

          friendly, ranandbe

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          That is is a windows forms application. However, this is not the PE header that was discussed before. This is the .NET entry point. The OS must be aware this is a .NET executable assembly already by this point.


          Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups