How to copy VS2019 Solution Folder from location one to another by drag and drop

Universal Camera 276 Reputation points
2021-09-20T18:57:56.043+00:00

I have a VS2019 solution in a Desktop Folder that compiles/deploy successfully. I copied/move this folder in my Document Folder. This copied Solution has error saying Android Namespace is not defined.

There are many post regarding this that are confusing. One article talked about opening .SLN file in text editor which I have no clue how to do. Is there a very simple drag and drop method.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 48,046 Reputation points
    2021-09-20T20:28:00.12+00:00

    A solution folder is self contained, or should be. Therefore you should be able to copy the entire solution directory (the folder containing the .sln file and having a separate folder for each project) and put it anywhere you want. Then when you open the solution up in Visual Studio it'll reload all the projects normally. Then recompile the solution and there shouldn't be any issues.d

    If you are getting build errors then most likely your project has hard coded references to stuff outside the solution directory. That will be on a per-project basis though so you'll have to look at which project is failing to compile.

    You shouldn't have to open the .sln file in a text editor unless you moved your project folders outside the solution directory or renamed them.

    Yes, drag and drop works for solutions. We do it all the time without any issues. Just be sure you're moving the entire solution directory and not a single project in it (which won't work).


  2. Universal Camera 276 Reputation points
    2021-09-25T02:14:33.627+00:00

    Namespace like Android you can imagine would be prevalent. In-fact there are 147 errors. Interestingly the code compiles and deploy despite these error. I don't want to see these errors!