none
Could not resolve mscorlib for target framework '.NETFramework,Version=v4.5'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted. RRS feed

  • General discussion

  • I upgraded an application developed in Visual Studio 8 to Visual Studio 2012.  When I try to display forms in designer, I get the error:

    Could not resolve mscorlib for target framework '.NETFramework,Version=v4.5'.  This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.

    I have the target framework set to .net framework 4.5 in Application properties.  My OS version is Windows 8 Pro so .net framework is installed as part of the OS.  Any suggestions why I'm getting this error?

    Sunday, March 3, 2013 5:06 AM

All replies

  • In Solution Explorer try showing all files (as seen in the image below, clicking on the double quotes then clicking on the dropdown lists looks like papers). Then look in the references folder and see if there is a reference that has a warning.


    You've taught me everything I know but not everything you know.

    Sunday, March 3, 2013 5:41 AM
  • On 3/3/2013 12:06 AM, DHCCS wrote:

    I upgraded an application developed in Visual Studio 8 to Visual Studio 2012.  When I try to display forms in designer, I get the error:

    Could not resolve mscorlib for target framework '.NETFramework,Version=v4.5'.  This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.



    I have the target framework set to .net framework 4.5 in Application properties.  My OS version is Windows 8 Pro so .net framework is installed as part of the OS.  Any suggestions why I'm getting this error?

    I suspect that the 'mscorlib' you are trying to use is not the correct version if your program you developed started out on .NET Framework 3.x.  Mscorlib is a .Net component. It's in the .NET Tab off of "Add Reference". Maybe you need to drop the old one out of your project and set reference to the one for the .NET Framework you are working with.

    http://dll.paretologic.com/detail.php/mscorlib

    Sunday, March 3, 2013 5:58 AM
  • Thanks for your replies.  I have no warnings on any of my references.  In VS 2012, you can not remove and add mscorlib.  When I go to "add Reference", there is not a .Net component option in VS 2012.  Mscorlib is located in "Add Reference, Assemblies, Framework" in VS 2012.  It does not allow you to remove or add it.  I get the message "A reference to 'mscorlib' could not be added.  This component is already automatically referenced by the build system."

    Thanks,



    • Edited by DHCCS Sunday, March 3, 2013 6:12 PM
    Sunday, March 3, 2013 6:11 PM
  • I resolved the issue by creating a new project and adding the forms, modules, etc. from my original project.
    Saturday, March 16, 2013 3:39 PM
  • There also similar error in project configuration editor.

    Error in project configuration editor


    • Edited by a.muliar Thursday, November 7, 2013 12:32 PM
    Thursday, November 7, 2013 12:32 PM
  • same trouble with VS2013 :(
    Friday, January 17, 2014 3:54 PM
  • Just Check references, if any reference give warning just remove it and add it.
    Monday, June 15, 2015 10:38 AM
  • Hi, my solution was, get especific version  and rebuild the solution!
    Thursday, December 1, 2016 4:34 PM
  • I got the same error message and the problem appeared to be the fact that the path to one of the files was too long.


    Jean-Paul Smit | Didago IT Consultancy
    Blog | Twitter | LinkedIn
    MCTS BizTalk 2006/2010 + Certified SOA Architect

    Please indicate "Mark as Answer" if this post has answered the question.

    Tuesday, December 13, 2016 9:37 AM
  • This is an issue with reference library. Solution is, Simply build the code, Build process restores all the references. This worked in VS 2015. Hope it will work

    Coded UI-MSDN

    Friday, March 31, 2017 6:28 AM
  • All though this post was awhile ago. Thanks for pointing me in the right direction. I found the missing reference, which I did have, so I removed it and chose a newer version of Microsoft.office.Core, it then worked.
    Friday, November 17, 2017 9:35 PM
  • Replying to the answer message from Sunday, March 3, 2013 5:58 AM.

    Thanks very much.  I now vaguely recall something like this but your answer short cut my issue right now which was for a VB .net 2005 project brought into VS 17 just now.  It was using 2.0 framework.

    By deleting two references in the tab you specified and rebuilding, the project worked perfectly.

    Regards

    Barry
    Saturday, November 16, 2019 12:38 AM