Visual Studio 2010: Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0'

前端 未结 21 2971
谎友^
谎友^ 2020-12-14 14:31

We are currently migrating all our solutions from 2005 to 2010 (that\'s right, we\'re skipping 2008!). We are also changing our file structure to make some more sense (some

21条回答
  •  佛祖请我去吃肉
    2020-12-14 14:40

    I ran into this issue today in Visual Studio 2017 on a project that I had apparently started out as a Universal Windows Platform application but ultimately settled on a Windows Forms desktop application.

    Somehow, either through a branching mistake or commit problem in source control, some of the obsolete/discarded UWP XAML files, along with a "project.json" file wound up back in my project folder. VS would no longer build or launch my Windows Forms app with a similar error as reported by others above (e.g., "Could not resolve mscorlib for target framework '.NETFramework,Version=v4.7'").

    After deleting all of the obsolete UWP junk (including "project.json", all the XAML files, and any other related nonsense) out of the project folder and reloading the solution, the errors went away and the project both built and launched successfully.

    Hope this helps.

提交回复
热议问题