Share via


Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0,Profile=Client'.

Question

Monday, February 4, 2019 3:43 PM

Hi everyone,

I am running VS 2017 Community and trying to open a file from my github repository but getting this error message. "Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0,Profile=Client'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted."

Any help would be greatly appreciated. Thanks.

All replies (1)

Tuesday, February 5, 2019 12:22 PM

Hi mrhood,

Welcome to the MSDN forum.

Have you installed .net framework 4.0? you can check the integrity of your .NET Framework(s) with this tool: http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx Run the tool with .NET 4.0 selected, then check the last few lines of the tool log for the test app return code. If the return code is not 0, the framework is corrupt and must be repaired via tool: https://www.microsoft.com/en-us/download/details.aspx?id=30135 first.

As far as to my knowledge, Mscorlib is a .Net component. It's in the .NET Tab off of "Add Reference". based on your error message, it seems be related with reference library. I suspect that the 'mscorlib' you are trying to use from this file, is not the correct version. please have a look at the references folder under this project, if there has a warning, create a new project and manually adding all of the references back, then rebuild it. build process restores all the references. it is a complex method but it is also the direct way to find the specific reference that leads to this issue. Or Please try to drop the old one out of your project and set reference to the one for the .NET Framework you are working with.

Besides, i find some members have encountered similar situation as you, “Click on the project name (right click) property under Explorer - Change the .NET Framework 4 Client Profile to .NET Framework 4.”

If any updates, we are pleased to share with you.

Best Regards

May

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]