Unmanaged codes for C#?

Please corrected me if I was wrong, because I discuss this issue with my supervisor.

Typically C# writes the managed codes and unsafe codes, but my supervisor insisted that C# could write unmanaged codes, at least in .NET Framework 1.0( ). I know C# could work with unmanaged codes, but I doubt C# could write unmanaged codes. C# need CLR, right



Answer this question

Unmanaged codes for C#?

  • Andrew

    Yes, the C# code is always managed... the unmanaged DLL’s that it calls remain unmanaged regardless of what you call them from. The only way to make those DLL’s be managed would be to recompile them with managed support (like the /clr flag).

  • Nehal Jain

    Thanks! Even C# can call/use unmanaged DLLs, but it is still managed codes, right


  • kReynolds

    You are correct, C# can write unsafe code, but C# is managed..

    But C# can call/use unmanaged DLL's.. maybe that is what he meant



  • Shivi

    Yes it will always be managed. But you can create a managed dll in C# that can be consumed by non-managed languages like C++

  • Unmanaged codes for C#?