model-view-controllervisual-studio-2017file-movesln-file

Moving MVC folders to root causing errors


For version control I have moved all my projects folders from the myproject folder to the root where packages and myproject.sln reside and when I open myproject.sln I get 'One or more projects in the solution were not loaded correctly. Please see the Output Window for details'. I then tried opening myproject.csproj and the project opened but when I built it I get the error 'This project references Nuget package(s) that are missing on this computer'. I've tried editing myproject.sln and myproject.csproj but it still throws the same error.

enter image description here

What do I need to do to get the project to work with this layout?


Solution

  • I finally fixed the issue by refreshing my Nuget packages and changing ..\packages to .\packages in the .csproj file. I also had to remove and re-install Newtonsoft.Json but it all works fine now.