I'm running .NET 4, have Visual Studio 2012 and I compiled
a program by csc with debug flag.
However when I run mdbg I have an error: the debugger protocol is incompatible with debug object Exception HRESULT 0x8013134B.
So, is mdbg incompatible with .NET 4.0 and there is another debugger?
You are using an old version of MDbg, it can only work with the CLR v2.0.50727 debugger interfaces. Which were updated for CLR v4.0.30319, the CLR version for .NET 4.0 and .NET 4.5.
You can download it CLR Managed Debugger (mdbg) Sample 4.0