title: How to locate buffer overruns in a .NET program that calls native functions
body: <p>I have a C# program that makes several calls to a native image processing library (MIL).  The library is not type safe; we need to be very careful when calling a function, making sure we provide the proper buffer type / size.</p>
  
  <p>Is there a way in Visual Studio, or is there a tool, to detect when a buffer overrun occurs?  In C/C++ applications, MSVC adds a special zone after buffers (in debug) to detect overruns.  That would be useful in .Net applications that call native code.</p>