If set a breakpoint then step into, you can notice the following in one CDumpContext::operator<<
Code:
#ifdef _AFXDLL
      pOb->Dump(*this);
#else
      *this << _T("Unable to dump object in static release builds");
#endif
That means in your project _AFXDLL is not defined, most possible because you are using static libraries of MFC.
To get rid of that, change "Use MFC in a Static Library" to "Use MFC in a Shared DLL", in your project properties.
Alternatively, in this particular case, you can call CFile::Dump instead of using << operator.
Code:
   // afxDump << file; // <-- replace this.
   file.Dump(afxDump);