×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

an entry level question about .NET

Hi DXs,
I am a newbie for .NET. a question for your guys.

I compiled a c# file to .exe file.

> csc myprogram.cs

I got myprogram.exe

Based on the document of .NET, I thought the .exe should be a PE (portable exe) file, which can be only executed on Runtime. But I was confused that I can run it directly in command environment just like a native .exe file.
My question is the .exe file is a PE (MSIL and metadata) or native exe file. If the .exe is PE file, does that mean Windows (with .NET framework installed) can recognize a PE file and load runtime to run the .exe?

Any help will be appreciated.
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / an entry level question about .NET
    Hi DXs,
    I am a newbie for .NET. a question for your guys.

    I compiled a c# file to .exe file.

    > csc myprogram.cs

    I got myprogram.exe

    Based on the document of .NET, I thought the .exe should be a PE (portable exe) file, which can be only executed on Runtime. But I was confused that I can run it directly in command environment just like a native .exe file.
    My question is the .exe file is a PE (MSIL and metadata) or native exe file. If the .exe is PE file, does that mean Windows (with .NET framework installed) can recognize a PE file and load runtime to run the .exe?

    Any help will be appreciated.
    • 基本是这样,只是PE文件不是操作系统认出来的,而是它有个文件头,在自己在执行时会把控制交给.net runtime(和java runtime 不同),
      • Can the .exe be executed on other OS (suppose .NET framework installed)?
        • 理论上可以,实际上似乎在某种linux上实现了.net framework,在这样的平台上可以运行.net。 前提是没有调用.net framework以外的东西。离了windows的com+等服务的支持,看不出这样做有什么意义
          • thx