tags:

views:

149

answers:

1

I do know some "basic" differences but there are still some questions in my mind:

  • What's their difference in performance at runtime? //This I really wanna know.
  • Why can't you build a MSIL assembly using C++/CLI?
  • What's the PE code (Not the .NET's PEKind) of a MSIL/CIL assembly? (C++/CLI assemblies have the same PE Code than unmanaged binaries, right?)

Any further knowledge/answers are appreciated.

+1  A: 

A C++/CLI assembly can contain native code, which has the potential to be more performant than managed code. However, the transitions between native and managed code (usually when calling into a native class, or a native API call) involves some automatically-generated marshalling and boxing, which can really suck up some cycles.

As to your second question, you can. Take a look at /clr:pure.

Managed and mixed-mode assemblies are both DLLs, but they have extended .NET metadata. Pure MSIL assemblies just don't have a native interface (try dumpbin /exports C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.v3.5.dll, then ildasm the same file).

Ben Straub