将 MVC 文件夹移动到根导致错误

Moving MVC folders to root causing errors

为了版本控制,我已将所有项目文件夹从 myproject 文件夹移动到包和 myproject.sln 所在的根目录,当我打开 myproject.sln 时,我得到 'One or more projects in the solution were not loaded correctly. Please see the Output Window for details'。然后我尝试打开 myproject.csproj 并打开了项目,但是当我构建它时出现错误 'This project references Nuget package(s) that are missing on this computer'。我试过编辑 myproject.sln 和 myproject.csproj 但它仍然会引发相同的错误。

我需要做什么才能使项目使用此布局?

我终于通过刷新我的 Nuget 包并将 ..\packages 更改为 .\packages 在 .csproj 文件中解决了这个问题。我还必须删除并重新安装 Newtonsoft.Json 但现在一切正常。