Here is my Solution files structure (folders are prefixed by +
):
+FooProject
FooProject.sln
+Tests
+BarTests
BarTests.csproj
Now I want to move the BarTests project to a new subfolder UnitTests
:
+FooProject
FooProject.sln
+Tests
+UnitTests
+BarTests
BarTests.csproj
I tried the following ways but to no avail:
UnitTests
, in Visual Studio, and move the BarTests
to UnitTests
folder in Visual Studio, then no new folder is created on disk, and no changes to the solution file are made, hence can't propagate this change in the source control.UnitTests
folder directly on disk (using File Explorer or Command Line), move the BarTests
to UnitTests
, and then manually update the solution file to reflect this change in the path. Now the problem is in Visual Studio, I still see the BarTests
project under the 'Tests' folder and not the UnitTests
folder.I tried the second approach even after closing VS and deleting the .vs
folder but still the same behavior.
What am I missing here?
Solution folders within Visual Studio are just used to organise solution-level assets such as projects and other solution folders within Visual Studio itself and are not permeated to disk.
When you move a folder on disk and change the reference to it within the .sln file, you are doing exactly that.
Really simple solution, do exactly what you have tried already and you can even do it within Visual Studio by switching to "Folder View" within the Solution Explorer.