LNK1123 error when bulding VC++ 2010 project after installing Visual Studio 2012 or .NET Framework 4.5

S’applique à : Visual Studio Premium 2010Visual Studio Professional 2010Visual Studio Ultimate 2010


Issue description: When building a VC++ 2010 project, you get “LNK1123: failure during conversion to COFF: file invalid or corrupt” link error.

This error can appear after installing Visual Studio 2012 side-by-side (SXS) with Visual Studio 2010 RTM or after installing .Net Framework 4.5 on a machine with Visual Studio 2010.

Cause: The issue is caused by a dependency failure of cvtres.exe on msvcr100_clr0400.dll which is shipped with Visual Studio 2010 RTM and eventually updated with a new version when Visual Studio 2012 RTM or .NET Framework 4.5 is installed.

Resolution: To resolve this link error, upgrade Visual Studio 2010 RTM to VS 2010 SP1. Upgrading to VS 2010 SP1 resolves the dependency failure and the VC++ 2010 project builds with no LNK1123 error.

More Information

This issue is specific to Visual Studio 2010 RTM based VC++ projects.