MIDL2398 error building with Visual Studio 2010 on Windows 2012

I figured out the problem.

I installed the SysInternals suite ( http://technet.microsoft.com/en-US/sysinternals ) on the build server and then used Process Monitor (procmon) to see what MIDL.exe was trying and failing to do.

In my case, it turned out that there was a file at the root of the C: drive named "Program", so the path to this file was "C:\Program". I don't know what or why, but MIDL.exe was doing something with this file. I renamed the file to "Program--MW", and the MIDL2398 error went away.

If anyone else runs into the MIDL2398 error, I recommend that you also use SysInternals' Process Monitor, add a filter for Process Name -- Contains -- midl, run your compiler and examine the Process Monitor log for errors and strange behavior. It worked for me!


On VS2012, the midl error was caused by com0com installer which created the file Program under the C drive. This is messing with the MIDL as mentioned earlier.

The file C:\Program had the following. Just renaming this file to something else, Ex: C:__Program makes Midl happy.

DIALOG: {
SetupOpenInfFile(C:\WINDOWS\system32\com0com.inf) on line 0
ERROR: 2 - The system cannot find the file specified.


} ...