none
VS2012 RC installation breaks VS2010 C++ projects

    Question

  • After installing VS2012 RC I can't compile my VC projects in VS2010.

    I receive "fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt".

    Saturday, June 02, 2012 11:38 AM

Answers

  • Do you have VS2010 SP1 installed? In the Compatibility page it states that:

    If Visual Studio 2012 RC and Visual Studio 2010 with SP1 are installed on the same computer, you can open the project in both of those versions of Visual Studio.

    Monday, June 04, 2012 12:36 PM

All replies

  • Please help me!

    I extremely need working Visual Studio to complete my project by Monday. Uninstalling VS 2012 didn't fix the problem, as soon as reinstalling VS 2010.

    Will try to uninstall everything - Studio, SDK - but I'm afraid it will not help.

    • Proposed as answer by mdh2008 Friday, August 24, 2012 8:33 PM
    • Unproposed as answer by mdh2008 Friday, August 24, 2012 8:33 PM
    • Proposed as answer by windows update nao funciona Sunday, March 03, 2013 6:47 PM
    Saturday, June 02, 2012 1:25 PM
  • Btw, Visual Studio 2008 is still working.
    Saturday, June 02, 2012 1:32 PM
  • Got the same error on my desktop PC when compiling a new, bare c++ project with Visual Studio 2010 and VS2012RC installed. This combination on my laptop gives no problem at all.
    Sunday, June 03, 2012 11:11 AM
  • I've managed to get it work again by re-installing visual studio
    • Proposed as answer by hberntsen Sunday, June 03, 2012 7:13 PM
    Sunday, June 03, 2012 7:13 PM
  • I've managed to get it work again by re-installing visual studio

    I have exactly the same problem, but reinstalling vs2010 didn't solve it. I can make it work again olny by uninstaling both vs2010 and vs2012, and then intalling vs2010 again. Is that what you have been doing, or you just reinstalled vs2010 and it began to work?
    Sunday, June 03, 2012 8:04 PM
  • Mikhail-ITS,

    Welcome to the MSDN forum.

    Sorry for having you run into this issue, actually, installing beta software on a production system is a high risk maneuver.

    Now please try to fully uninstall VS2012 through control panel then uninstall VS2010 with this tool 

    http://archive.msdn.microsoft.com/vs2010uninstall

    (PS: Since you have installed VS2008 on your OS, first just try default command )

    Then re-install VS2010, tell me if there is any error when installing.

    Thanks,

     


    Barry Wang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, June 04, 2012 6:52 AM
    Moderator
  • I think I've found a solution for some C++ projects in vs2010. If you are using 'incremental linking' you will have this "fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt". In my case I've swiched it to "No", and now project compiles and run without any problem.

    If you want to try go to: Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"

    about "Incremental Linking": http://msdn.microsoft.com/en-us/library/4khtbfyf(v=vs.100).aspx

    • Proposed as answer by Dor Tzur Wednesday, August 22, 2012 10:44 AM
    Monday, June 04, 2012 10:58 AM
  • Do you have VS2010 SP1 installed? In the Compatibility page it states that:

    If Visual Studio 2012 RC and Visual Studio 2010 with SP1 are installed on the same computer, you can open the project in both of those versions of Visual Studio.

    Monday, June 04, 2012 12:36 PM
  • Thank you Fluesopp. After installing SP1 projects compiles with and without incremental linking, so it probably replaced/repaired linker.

    About that projects compatibility, it doesn't seem to work for me, maybe beacause of all that reinstalling.

    Monday, June 04, 2012 7:25 PM
  • I also get the same error but I do not have VS2010 installed on my system. I use VS2010 C++ express to compile the c++ projects. But after upgrading to VS2012 I get the "fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt". Anyone knows why this occurs?
    Wednesday, June 06, 2012 12:57 AM
  • We're having the same problem, while having no problems during the beta. I tried to turn off incremental linking, but it doesn't appear to make a difference. The problem only occurs in project that have resource files (.rc), and fails only on those during linking. The .res files generated do not seem to differ from systems without VS2012 installed.

    Due to our integrated build system based on VS2010, it's not trivial to update to SP1. Does anyone have any hints to where I might start looking for another solution, or what exactly is causing the problem in the first place? For as far as I can see, the environment variables seem correct, and we haven't been able to find any updated DLLs that seem suspicious. I'd hate to have to go through a complete uninstall of all my visual studios, and we'd really like to be able to use VS2012 as an IDE.

    Wednesday, June 06, 2012 9:45 AM
  • I think Murazor2222 is on to something here.  I am seeing the same error message but only for projects that have resource files.  FWIW, the VS2012 linker seems to work as a replacement, but of course that may not help people who would rather not change their production tools.
    Wednesday, June 06, 2012 3:35 PM
  • It's been reported that installing VS2010 SP1 should solve this problem. Does everyone with this problem have VS2010 RTM?


    - Heath @ http://blogs.msdn.com/heaths; Visual Studio Professional Deployment

    Tuesday, June 12, 2012 8:18 PM
    Moderator
  • I have been using VS 2010 C++ express. So could not install VS2010 SP1. Is there any other workaround for it?
    Wednesday, June 13, 2012 3:36 PM
  • I full uninstalled 2012 RC and 2010 then reinstalled 2010 to no avail.  However, updating to SP1 fixed the error I was receiving.
    • Proposed as answer by Jeganathan Wednesday, June 20, 2012 10:43 AM
    • Unproposed as answer by Jeganathan Wednesday, June 20, 2012 10:44 AM
    Friday, June 15, 2012 8:00 PM
  • I uninstalled 2012 RC, then opened the sln file with 2010 SP1. When I
    compile I get the following error:

    Error 1 error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets 518 6 Test2

    How do I get the sln file to work on 2010 SP!???

    - Reinstall 2010 SP1?
    - Restore from backup the sln file - or some other file
    - Something else?

    Thanks

    Friday, July 06, 2012 1:38 PM
  • If you have a recent backup, it may be best to restore it. Hopefully, though, it's no more difficult than changing the ToolsetVersion at the top of the SLN and/or *PROJ files to use "4.0" instead. It would help to see the declarations of your SLN and *PROJ files (you can remove any Item groups for safety) if that doesn't work.


    - Heath @ http://blogs.msdn.com/heaths; Visual Studio Professional Deployment

    Friday, July 06, 2012 5:26 PM
    Moderator
  • I discovered that if I edit the <PlatformToolset...> in each <proj>.vcxproj file from v110 to v100 then I can compile with VS2010 SP1. Unfortunately I first headed in the direction of repairing/uninstalling VS2010 with a plan to reinstall it. This was a big time wasting goof. The exe install (not the iso file) at MSDN subscriptions failed with a bunch of missing cab files. The exe install of SP1 failed with missing msi files. Both near the end of waiting a long time. The only success I had was using the iso files burned to DVD's. Now I'm waiting for Windows Update to install some update to VS2010 SP1.

    The "ToolsVersion" is already 4.0. There is no ToolsetVersion in either sln or vcxproj files.

    Friday, July 06, 2012 8:04 PM
  • I too did the same, it has totally messed up my computer, as bad as I need to be able to get back into VS2010 I get nothing but fatal error messages.  I have to go to class to do the work, and that is not always easy or possable.  If someone has the answer, please help.

    DawnP

    Wednesday, August 08, 2012 1:59 AM
  • I dislike having to use both, how can I uninstall VS 2012 and just use VS2010?  When I did this before, VS2010 did not work still.  I kept getting fatal error messages. Any help will be a big help.  Especially since there are no tutorials on how to work in VS2012 for those of us who are beginner programmers.

    DawnP

    Wednesday, August 08, 2012 2:04 AM
  • Search http://support.microsoft.com for "uninstall visual studio 2012" and you'll find instructions. Currently, the Beta instructions are the latest but will work for RC (product names in Add/Remove Programs might be slightly different, but will be obvious differences like "RC" instead of "Beta", or for SQL packages "RC" will be missing in the VS 2012 RC (since SQL release before our final RC was built).

    But after uninstalling 2012, you need to repair VS2010. In 2012 we implemented package ref-counting for most packages to solve the long-standing uninstall issues of past releases. However, some of those same packages (that didn't change between 2010 and 2012) don't benefit from ref-counting since they are older and do not use this feature.


    - Heath @ http://blogs.msdn.com/heaths; Visual Studio Professional Deployment

    Thursday, August 09, 2012 6:17 PM
    Moderator
  • Search http://support.microsoft.com for "uninstall visual studio 2012" and you'll find instructions.

    Sorry, but doing this search does not give any useful results. Can you provide a link to these instructions? I have something wrong with VS2012 RC that causes it to crash at breakpoints, which makes it pretty much useless. I have done an uninstall-reinstall cycle twice, and it still fails, so I think I am missing something on the uninstall.
    Sunday, August 12, 2012 6:28 PM
  • ^ THIS. Good job, this fixed my problem right away! Thank you so much for sharing. 
    Thursday, August 23, 2012 5:49 AM
  • I tracked down where the problem is coming from...

    ...the x86 version of cvtres.exe had changed.

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe

    Wrong version:  03/18/2010  01:16 PM            31,048 cvtres.exe
    Correct version: 02/21/2011  06:03 PM            31,056 cvtres.exe

    The wrong version has a dependancy on msvcr100_clr0400.dll
    The correct version has a dependancy on msvcr100.dll

    Fortunately, I had another VS2010 installation without VS2012 installed on it where I found the GOOD version of cvtres.exe.

    Once I copied the GOOD over the BAD everything builds sucessfully.

    Quicker solution than uninstalling and re-installing but you have to have a good version of the file.

    • Proposed as answer by mdh2008 Friday, August 24, 2012 8:57 PM
    Friday, August 24, 2012 8:55 PM
  • Did you install any pre-releases of VS2012?

    Also, to properly diagnose the problem we need install logs as requested. Please download and run http://aka.ms/vscollect, then upload %TEMP%\vslogs.cab to an Internet share like http://skydrive.com. Share the file and paste the URL here for further diagnostics.


    - Heath @ http://blogs.msdn.com/heaths; Visual Studio Professional Deployment

    Tuesday, August 28, 2012 6:05 PM
    Moderator
  • What is good job? what fixed your problem???I cannot find any solution to the problem till now
    Saturday, September 01, 2012 6:07 PM
  • I had the same problem with Visual Studio 2010 Ultimate (without SP1).

    I fixed the problem by uninstalling .NET Framework 4.5 and re-installing 4.0.

    hope this help


    P.S. Visual 2012 wasn't  installed, only had .NET Framework 4.5
    • Edited by Rafael_GV Sunday, September 02, 2012 4:47 PM
    • Proposed as answer by felipe.aburaya Wednesday, December 26, 2012 4:53 PM
    Sunday, September 02, 2012 4:41 PM
  • I installed VS 2010 SP, and compilation works well under VS 2012.  I did hit a bug with _MSC_VER being set incorrectly.  It's set to 1700 (VS 2012) for both the 2010 and 2012 compiler.  Shouldn't it pull the value from the compiler version as the docs state (not the native IDE compiler)?


    Sunday, September 09, 2012 7:26 PM
  • Fixed by excluding app.rc from the project. (Also turned out incremental build and manifest generation, but no joy til exluding that file)
    Monday, September 24, 2012 3:35 AM
  • Thank you so much pszczolek. I used your solution and it worked fine for me. 
    Wednesday, September 26, 2012 6:31 PM
  • Thanks alot....best solution saved my day.
    Tuesday, October 02, 2012 4:22 PM
  • Thank you very much for this - just to update the information for anyone else who has this problem.

    The "wrong version" of cvtres.exe is the one shipped in vs2010 RTM

    The "correct version" is one from vs2010 SP1.

    So if you do not have a SP1 version around to copy the file from upgrading to SP1 will sort the issue (as others in this thread have mentioned). 

    Just for clarity (there actually appear to be several problems discussed in this thread) - my issue and resolution was :-

    Had VS2010 RTM installed

    Installed VS2012 RTM (no beta's or previous versions used)

    This broke the linker for VS2010 when linking a .res file generated from a .rc with the error message given at the start of this thread.

    Our solution was to upgrade vs2010 to SP1 (didn't have SP1 available on any other machines since we tend not to automatically upgrade after been bitten by abi changes on vs2008RTM -> vs2008 SP1) but subsequent tests has shown that mdh2008 's answer was correct - simply changing the 1 file is suffecient.

    Wednesday, October 10, 2012 9:21 AM
  • I have installed first VS2012Ex and because I need to compile my dll for XP, I later installed VS2010Ex, changed the toolset to v100 and got this error.

    After reading this topic and trying all different suggestions about project properties (manifest generation/incremental linking), I kept getting the error.

    The solution that worked was replacing the cvtres.exe from VS2010 with  the one from VS2012.

    Wednesday, October 10, 2012 6:53 PM
  • Thanks mdh2008.  This works for me as well.  While I'd be reluctant to make a hack like this on a production build server (I'd probably install VS2010 SP1 instead), this is a perfect quick fix for a dev machine.
    Friday, November 02, 2012 8:57 PM
  • Great under-the-hood-work - thanks, fixed me!

    I need more memory. Wait - what was it I needed?

    Tuesday, December 18, 2012 3:44 PM
  • Worked for me. Thanks!

    By the way, I was not using Visual Studio 2010 exactly, but the Windows SDK v7.1. I had this issue reported by CMake from inside Qt Creator.
    • Edited by felipe.aburaya Wednesday, December 26, 2012 4:55 PM
    • Proposed as answer by Jack Dark Monday, October 28, 2013 7:56 PM
    • Unproposed as answer by Jack Dark Monday, October 28, 2013 7:56 PM
    Wednesday, December 26, 2012 4:53 PM
  • Thanks for sharing what you fixed and how you did it. Thanks
    Wednesday, February 27, 2013 3:34 AM
  • Where to get a copy of CVTRES.EXE made on 2/21/2011?

    Thanks mdh2008. Your solution makes the most sense!

    However I do not have any copy of the CVTRES.EXE made in February 2011. Where can I download this file?

    Thanks

    Wednesday, February 27, 2013 4:24 PM
  • Rename the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe, so that the newer cvtres.exe in C:\Windows\Microsoft.NET\Framework\v4.0.30319 will be chosen. 
    • Proposed as answer by RatnaAyu Tuesday, March 26, 2013 10:13 AM
    Tuesday, March 26, 2013 10:09 AM
  • I had the same problem with Visual Studio 2010 Ultimate (without SP1).

    I fixed the problem by uninstalling .NET Framework 4.5 and re-installing 4.0.

    hope this help


    P.S. Visual 2012 wasn't  installed, only had .NET Framework 4.5

    I had the same issue as well (Visual Studio 2012 has never been installed) with Visual Studio 2010 without Service Pack 1.  The error showed up only after installing .NET Framework 4.5.

    I can confirm that installing SP1 for Visual Studio 2010 Professional also fixes this error--without uninstalling .NET Framework 4.5 and re-installing 4.0.  

    I didn't look at the file "cvtres.exe" before installing SP1 for VS2010, but the file has the correct date (02/21/2011) as stated by mdh2008


    • Edited by draghn Monday, June 17, 2013 11:25 PM
    Monday, June 17, 2013 11:10 PM
  • thanks you so much
    Wednesday, November 13, 2013 4:26 AM
  • Thank you,  this worked for me,  I copied the GOOD file from the other computer over and fixed the problem.  Easy enough without installation/uninstallation suggested by other people


    ms seekle

    Thursday, March 13, 2014 3:14 PM
  • Thank you so much !!

    It really works !! :-)

    Monday, March 31, 2014 3:40 PM
  • Renaming cvtres.exe worked for me. Thanks!
    • Proposed as answer by Sammidav Friday, August 22, 2014 3:11 PM
    • Unproposed as answer by Sammidav Friday, August 22, 2014 3:11 PM
    Tuesday, April 22, 2014 8:20 PM
  • then,do i need to set this item everytime i write a proj?or how to set it permanently?
    Sunday, July 13, 2014 12:44 PM
  • A slightly different bent to this...

    A recent Windows Update for .Net 4.5.1 on some machines causes the same symptoms. We ship an OEM version of Visual C++ and may not have the right to ship an 'SP1' for it. The simplest solution was to locate the 4.5.1 version of cvtres.exe and cvtres.exe.config and place them in the bin directory of Visual C++. In effect using the 'BAD' version. Of course its not bad, its just that the old version is incompatible with a .Net 4.5.1 patch.


    regards Rob Goodridge

    Monday, July 14, 2014 10:28 PM
  • I am also facing the same problem. I installed Visual studio 2012 and damn no programs are getting compiled. 
    Saturday, September 13, 2014 9:02 AM
  • The solution that worked for me was the installation of SP1 for Visual Studio 2010 from:

    http://www.microsoft.com/en-us/download/confirmation.aspx?id=23691

    Btw, I have both .Net 4.0 and .Net 4.5 with 4.5 installed after 4.0. This seems to indicate that it is not a problem caused by .Net version, at least not for me.

    Thanks to those offering solutions and those that indicate how was fixed for them.

    • Edited by Martin Mace Tuesday, March 03, 2015 4:31 PM
    Tuesday, March 03, 2015 4:23 PM